您的位置:首页 > 其它

获取指定字符串出现的次数

2014-06-13 12:00 309 查看
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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: