C# string.Replace 不区分大小写

时间:2021-08-02 14:55:57   收藏:0   阅读:28

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

原文:https://www.cnblogs.com/networkpilot/p/15088655.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!