1.检测该字符串是否 带有字符“8”(类似sql语句:select * from tableName where name like '%8%')
string pattern = @"\w*8\w*";
string inputString = "第8幢";
string result = Regex.IsMatch(inputString, pattern).ToString();
Console.WriteLine(result);
Console.ReadLine();
2023-03-12 09:03:09
1.检测该字符串是否 带有字符“8”(类似sql语句:select * from tableName where name like '%8%')
string pattern = @"\w*8\w*";
string inputString = "第8幢";
string result = Regex.IsMatch(inputString, pattern).ToString();
Console.WriteLine(result);
Console.ReadLine();
下一篇:05-KNN 基础学习