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

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

Leave a Reply