Wednesday, July 2, 2014

Format to first letter upper case

Globalization can help to chnage the first letter to upper case, Here is how in C#:

string test = "Test UppEr";
string formatted = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(test);

Result will be "Test Upper"

No comments:

Post a Comment