Here you can find the source of regionMatches(CharSequence cs, boolean ignoreCase, int thisStart, CharSequence substring, int start, int length)
static boolean regionMatches(CharSequence cs, boolean ignoreCase, int thisStart, CharSequence substring, int start, int length)
//package com.java2s; //License from project: Apache License public class Main { static boolean regionMatches(CharSequence cs, boolean ignoreCase, int thisStart, CharSequence substring, int start, int length) { if (cs instanceof String && substring instanceof String) { return ((String) cs).regionMatches(ignoreCase, thisStart, (String) substring, start, length); } else {//from ww w. j a va 2s.c om // TODO: Implement rather than convert to String return cs.toString().regionMatches(ignoreCase, thisStart, substring.toString(), start, length); } } }