- Back to Home »
- C# »
How to convert all first letters of a sentence into upper case and rest of the letters into lower case?
Posted by : Jebastin
Tuesday, 7 January 2014
The following C# code is used to convert all first letters of a sentence into upper case and rest of the letters into lower case.
- string s = "THIS IS MY TEXT RIGHT NOW";
- s = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());
- // (or)
- s = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());