List of utility methods to do String Occurence Count
int | countOccurencesOfChar(String str, char charToCount) count Occurences Of Char int len = str.length(); int occurences = 0; String strgToCount = Character.toString(charToCount); for (int index = 0; index < len; ++index) { String substr = str.substring(index, index + 1); if (strgToCount.equals(substr)) { occurences++; return occurences; |