String src = "test,ttt,tye";
String dst = "<" + "tes" + "|" + "tt" + ">";
Pattern p = Pattern.compile(dst);
Matcher m = p.matcher(src);
boolean b = m.find();
判断字符串中是否包含某些子串
最新推荐文章于 2024-05-09 21:30:20 发布
String src = "test,ttt,tye";
String dst = "<" + "tes" + "|" + "tt" + ">";
Pattern p = Pattern.compile(dst);
Matcher m = p.matcher(src);
boolean b = m.find();