Tests if two string regions are equal.
A substring of this String object is compared to a substring of the argument other. The result is true if these substrings represent character sequences that are the same, ignoring case if and only if ignoreCase is true. The substring of this String object to be compared begins at index toffset and has length len. The substring of other to be compared begins at index ooffset and has length len. The result is false if and only if at least one of the following is true:
this.charAt(toffset+k) != other.charAt(ooffset+k)
and:Character.toLowerCase(this.charAt(toffset+k)) != Character.toLowerCase(other.charAt(ooffset+k))
Character.toUpperCase(this.charAt(toffset+k)) != Character.toUpperCase(other.charAt(ooffset+k))
ignoreCase | if true , ignore case when comparing
characters. | |
toffset | the starting offset of the subregion in this string. | |
other | the string argument. | |
ooffset | the starting offset of the subregion in the string argument. | |
len | the number of characters to compare. |
true
if the specified subregion of this string
matches the specified subregion of the string argument;
false
otherwise. Whether the matching is exact
or case insensitive depends on the ignoreCase
argument.
Diagram: String