我怎样才能改变角色案例?

时间:2010-08-01 16:05:00

标签: c#

如何更改字符大小写,结果如下:

"hello" = "Hello"
"hello germany" = Hello Germany"

问候

2 个答案:

答案 0 :(得分:1)

答案 1 :(得分:1)

static void Main(string[] args)
{
    string myString = "hello, world!";
    Console.WriteLine(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(myString));
    Console.Read();
}