Here you can find the source of regionMatches(CharSequence receiver, int thisOffset, String other, int otherOffset, int length, boolean ignoreCase)
public static boolean regionMatches(CharSequence receiver, int thisOffset, String other, int otherOffset, int length, boolean ignoreCase)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean regionMatches(CharSequence receiver, int thisOffset, String other, int otherOffset, int length, boolean ignoreCase) { if (ignoreCase) { for (int i = 0; i < length; i++) { if (Character.toLowerCase(receiver.charAt(i + thisOffset)) != Character .toLowerCase(other.charAt(i + otherOffset))) return false; }//from w w w.ja v a 2 s .c o m } else { for (int i = 0; i < length; i++) { if (receiver.charAt(i + thisOffset) != other.charAt(i + otherOffset)) return false; } } return true; } }