C# implementation, directly using string ToLower() method can
string str = "ABcD".ToLower(); // 大写字母转成小写字母
string str1 = "abcD".ToUpper(); // 小写字母 转成 大写字母
- Code reference:
using System;
using System.Collections.Generic;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
string str = Console.ReadLine();
Console.WriteLine("转换前 : {0}", str);
Console.WriteLine("转换后 : {0}", str.ToLower());
Console.ReadLine();
}
}
}