code: 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);
      }
docs: This methods make regionMatches operation correctly for any chars in strings
  @param cs the {@code CharSequence} to be processed
  @param ignoreCase specifies if case should be ignored.
  @param csStart the starting offset in the {@code cs} CharSequence
  @param string the {@code CharSequence} to compare.
  @param start the starting offset in the specified {@code string}.
  @param length the number of characters to compare.
  @return {@code true} if the ranges of characters are equal, {@code false} otherwise.