Java Utililty Methods String Match

List of utility methods to do String Match

Description

The list of methods to do String Match are organized into topic(s).

Method

booleanregionMatches(final CharSequence cs, final boolean ignoreCase, final int thisStart, final CharSequence substring, final int start, final int length)
region Matches
if (cs instanceof String && substring instanceof String) {
    return ((String) cs).regionMatches(ignoreCase, thisStart, (String) substring, start, length);
int index1 = thisStart;
int index2 = start;
int tmpLen = length;
while (tmpLen-- > 0) {
    char c1 = cs.charAt(index1++);
...
booleanregionMatches(final CharSequence seq1, final int start1, final CharSequence seq2, final int start2, final int len, final boolean ignoreCase)
region Matches
if (start1 < 0 || start2 < 0)
    throw new IllegalArgumentException();
if (seq1.length() < start1 + len)
    throw new IllegalArgumentException();
if (seq2.length() < start2 + len)
    throw new IllegalArgumentException();
return uncheckedRegionMatches(seq1, start1, seq2, start2, len, ignoreCase);
booleanregionMatches(String string, int toffset, StringBuffer other, int ooffset, int len)
region Matches
if (toffset < 0 || (toffset + len) > string.length())
    return false;
if (ooffset < 0 || (ooffset + len) > other.length())
    return false;
while (len-- > 0) {
    if (string.charAt(toffset++) != other.charAt(ooffset++))
        return false;
return true;
booleanregionMatchesIgnoreCase(char[] string, int toffset, String other, int ooffset, int len)
region Matches Ignore Case
if (toffset < 0 || (toffset + len) > string.length)
    return false;
if (ooffset < 0 || (ooffset + len) > other.length())
    return false;
while (len-- > 0) {
    if (Character.toUpperCase(string[toffset++]) != Character.toUpperCase(other.charAt(ooffset++)))
        return false;
return true;