April 19, 2013

Make string title case in C#

We generally use ToLower or ToUpper in C#.But how can we change a string in title case.

Yes we can.We have System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase.
It takes string as parameter.

string strText = “my blog”;
string strTitleCase = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(strText);

That's It.
Enjoy Learning.

No comments:

Post a Comment