C#在字符串中查询指定字符串是否存在

Regex r = new Regex("abc"); // 定义一个Regex对象实例

Match m = r.Match("123abc456"); // 在字符串中匹配

if (m.Success)
posted @ 2020-03-10 16:47  LcVong  Views(1969)  Comments(0Edit  收藏  举报