C# ToUpperInvariant() 方法用于使用不变区域性的大小写规则将字符串转换为大写字符串。
public string ToUpperInvariant()
它不带任何参数
它返回一个字符串。
using System; public class StringExample { public static void Main(string[] args) { string s1 = "Hello C#"; string s3 = s1.ToUpperInvariant(); Console.WriteLine(s3); } }
输出:
HELLO C#