C# string.Replace 不区分大小写

string input = "hello WoRlD";
string result =
Regex.Replace(input, "world", "csharp", RegexOptions.IgnoreCase);
Console.WriteLine(result); // prints "hello csharp"

posted @ 2021-08-02 09:40  贾金龙  阅读(300)  评论(0编辑  收藏  举报