public boolean regionMatches ( int thisStart , CharSequence string , int start , int length ) { if ( string == null ) { throw new NullPointerException ( "string" ) ; } if ( start < 0 || string . length ( ) - start < length ) { return false ; } final int thisLen = length ( ) ; if ( thisStart < 0 || thisLen - thisStart < length ) { return false ; } if ( length <= 0 ) { return true ; } final int thatEnd = start + length ; for ( int i = start , j = thisStart + arrayOffset ( ) ; i < thatEnd ; i ++ , j ++ ) { if ( b2c ( value [ j ] ) != string . charAt ( i ) ) { 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 .