public static boolean regionMatches ( final CharSequence cs , final boolean ignoreCase , final int csStart , final CharSequence string , final int start , final int length ) { if ( cs == null || string == null ) { return false ; } if ( cs instanceof String && string instanceof String ) { return ( ( String ) cs ) . regionMatches ( ignoreCase , csStart , ( String ) string , start , length ) ; } if ( cs instanceof AsciiString ) { return ( ( AsciiString ) cs ) . regionMatches ( ignoreCase , csStart , string , start , length ) ; } return regionMatchesCharSequences ( cs , csStart , string , start , length , ignoreCase ? GeneralCaseInsensitiveCharEqualityComparator . INSTANCE : DefaultCharEqualityComparator . INSTANCE ) ; }
This methods make regionMatches operation correctly for any chars in strings