How to uppercase the first letter of each word in C# and VB.NET

To uppercase the first letter of each word in C# and VB.NET you can use the following snippet.

Sample C#

public static string ToTitleCase(string input)
{
	return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(input);
}

Sample VB.NET

Public Shared Function ToTitleCase(input As String) As String
	Return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(input)
End Function

Please Share us:
Please rate this snippet

4 thoughts on “How to uppercase the first letter of each word in C# and VB.NET

Leave a Reply