) method compares a
specific region inside a string with another specific region in another string. There is an overloaded form
that allows you to ignore case in such comparisons. Here are the general forms for these
boolean regionMatches(int startIndex,
boolean regionMatches(boolean ignoreCase,
For both versions, startIndex
specifies the index at
which the region begins within the invoking String
object. The String
being compared is
specified by str2.
The index at which the comparison will start within str2
is specified by str2StartIndex.
The length of the
substring being compared is passed in numChars.
In the second version, if ignoreCase
case of the characters is ignored. Otherwise, case is significant.