public boolean regionMatches (boolean ignoreCase, int toffset, String other, int ooffset, int len)

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:

`toffset`is negative.`ooffset`is negative.`toffset+len`is greater than the length of this`String`object.`ooffset+len`is greater than the length of the other argument.`ignoreCase`is`false`and there is some nonnegative integer*k*less than`len`such that:this.charAt(toffset+k) != other.charAt(ooffset+k)

`ignoreCase`is`true`and there is some nonnegative integer*k*less than`len`such that:

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