C#通过ToUpper()方法将字符串转换成大写,代码如下:
string sentence= "this is in upper case.";
Console.WriteLine(sentence.ToUpper());
C#通过ToLower()方法将字符串转换成小写,代码如下:
string sentence= "this is in Lower case.";
Console.WriteLine(sentence.ToLower());