public boolean regionMatches ( boolean ignoreCase , int thisStart , CharSequence string , int start , int length ) { if ( ! ignoreCase ) { return regionMatches ( thisStart , string , start , length ) ; } if ( string == null ) { throw new NullPointerException ( "string" ) ; } final int thisLen = length ( ) ; if ( thisStart < 0 || length > thisLen - thisStart ) { return false ; } if ( start < 0 || length > string . length ( ) - start ) { return false ; } thisStart += arrayOffset ( ) ; final int thisEnd = thisStart + length ; while ( thisStart < thisEnd ) { if ( ! equalsIgnoreCase ( b2c ( value [ thisStart ++ ] ) , string . charAt ( start ++ ) ) ) { return false ; } } return true ; }
Compares the specified string to this string and compares the specified range of characters to determine if they are the same . When ignoreCase is true the case of the characters is ignored during the comparison .