I want to format a string value by a certain format that the first letter
of it be in Uppercase
.
e.g:
string.Format("{0}", "myName"); //Output must be : "MyName"
How can I do it?
Please check MSDN for your case, see TextInfo.ToTitleCase Method .
string myString = "wAr aNd pEaCe";
TextInfo myTI = new CultureInfo("en-US", false).TextInfo;
Console.WriteLine("\"{0}\" to titlecase: {1}", myString, myTI.ToTitleCase(myString));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With