/**
* 查询字符串中指定字符个数
* @param oriStr 原字符串
* @param findStr 需要查找的字符
* @param count 固定值:0
* @return 查找到字符的个数
*/
public static int findStrCount(String oriStr, String findStr, int count) {
if (oriStr.contains(findStr)) {
count++;
count = findStrCount(oriStr.substring(oriStr.indexOf(findStr) + findStr.length()), findStr, count);
}
return count;
}
07-04
2754
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交