ToProperCase

public static string ToProperCase(this string text)
{
	System.Globalization.CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
	System.Globalization.TextInfo textInfo = cultureInfo.TextInfo;
	return textInfo.ToTitleCase(text);
}
Example:
string s = "tHiS is a sTring TesT";
Console.WriteLine("Title Case: {0}", s.ToProperCase());

// Output: This Is A String Test

Description

Converts string to a title case.

Details

Double click on the code to select all.

 

;