Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static Integer countOccurrences(String value, String pattern) {
- Integer result = 0;
- if (StringUtil.isNotEmpty(value) && StringUtil.isNotEmpty(pattern)) {
- String aux = value.replaceAll(pattern, "");
- result = value.length() - aux.length();
- }
- return result;
- }
Add Comment
Please, Sign In to add comment