List of utility methods to do CharSequence Search
int | findCommonPrefixLength(CharSequence str1, CharSequence str2) find Common Prefix Length int length = (Math.min(str1.length(), str2.length())); for (int i = 0; i < length; i++) { if (str1.charAt(i) != str2.charAt(i)) { return i; return 0; |
int | findCommonSuffixLength(CharSequence str1, CharSequence str2, int commonPrefixLength) find Common Suffix Length int length = (Math.min(str1.length(), str2.length())); for (int i = 0; i < length - commonPrefixLength; i++) { if (str1.charAt(str1.length() - i - 1) != str2.charAt(str2 .length() - i - 1)) { return i; return 0; ... |
int | indexOfDifference(CharSequence cs1, CharSequence cs2) index Of Difference if (cs1 == cs2) { return INDEX_NOT_FOUND; if (cs1 == null || cs2 == null) { return 0; int i; for (i = 0; i < cs1.length() && i < cs2.length(); ++i) { ... |