Guest User

Untitled

a guest
Aug 14th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1.     private static Integer countOccurrences(String value, String pattern) {
  2.        
  3.         Integer result = 0;
  4.        
  5.         if (StringUtil.isNotEmpty(value) && StringUtil.isNotEmpty(pattern)) {
  6.             String aux = value.replaceAll(pattern, "");    
  7.             result = value.length() - aux.length();
  8.         }
  9.        
  10.         return result;
  11.     }
Add Comment
Please, Sign In to add comment