List of utility methods to do Char Count
int | charCount(final String s, final char c) char Count int r = 0; for (int i = 0, len = s != null ? s.length() : 0; i < len; i++) { if (c == s.charAt(i)) { r++; return r; |
int | charCount(final String s, final char c) Get the number of the occurence of a char in a string. if (s == null) return 0; final int len = s.length(); int count = 0; for (int i = 0; i < len; i++) if (s.charAt(i) == c) count++; return count; ... |
int | charCount(int codePoint) char Count return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT ? 2 : 1;
|
int | charCount(String s, char c) char Count int res = 0; for (char ch : s.toCharArray()) if (ch == c) res++; return res; |
int | charCount(String source, char target) char Count if (source == null) { return 0; int count = 0; for (int i = 0; i < source.length(); i++) { if (target == source.charAt(i)) { count++; return count; |
int | charCount(String str, char c, boolean countEscaped) Helper method to count number of given characters in a string. if (str == null) return -1; int cnt = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == c) { if (i >= 1) { if (str.charAt(i - 1) == '\\') { if (countEscaped) { ... |
int | charCount(String str, char chr) char Count int count = 0; if (str != null) { int length = str.length(); for (int i = 0; i < length; i++) { if (str.charAt(i) == chr) { count++; return count; return count; |
int | charCount(String str, char sub) char Count int charCount = 0; int fromIndex = 0; while ((fromIndex = str.indexOf(sub, fromIndex)) != -1) { fromIndex++; charCount++; return charCount; |
int | charCount(String subject, String needle) char Count return subject.split(needle).length - 1;
|
int | charCountRight(String str, String sub) char Count Right if (str == null) { return 0; int charCount = 0; String subStr = str; int currentLength = subStr.length() - sub.length(); while (currentLength >= 0 && subStr.substring(currentLength).equals(sub)) { charCount++; ... |