ExtensionMethod.NET Home of 841 C#, Visual Basic, F# and Javascript extension methods


Converts string to a title case.


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);


string s = "tHiS is a sTring TesT";
Console.WriteLine("Title Case: {0}", s.ToProperCase());

// Output: This Is A String Test

Author: Earljon Hidalgo

Submitted on: 26 mrt 2008

Language: C#

Type: System.String

Views: 7942