ublic static int findStr2(String srcText, String keyword) {
int count = 0;
Pattern p = Pattern.compile(keyword);
Matcher m = p.matcher(srcText);
while (m.find()) {
count++;
}
return count;
}
获取指定字符串出现的次数
最新推荐文章于 2022-03-14 13:38:44 发布