格式化字符串文字

Ham*_*d62 4 .net c# string

我想通过格式化的特定格式的字符串值,first letter它是Uppercase.
例如:

string.Format("{0}", "myName"); //Output must be : "MyName"
Run Code Online (Sandbox Code Playgroud)

我该怎么做?

Uri*_*iil 5

请查看MSDN以了解您的情况,请参阅TextInfo.ToTitleCase方法.

string myString = "wAr aNd pEaCe";        
TextInfo myTI = new CultureInfo("en-US", false).TextInfo;
Console.WriteLine("\"{0}\" to titlecase: {1}", myString, myTI.ToTitleCase(myString));
Run Code Online (Sandbox Code Playgroud)