Here you can find the source of substringMatch(CharSequence str, int index, CharSequence substring)
public static boolean substringMatch(CharSequence str, int index, CharSequence substring)
//package com.java2s; //License from project: Apache License public class Main { public static boolean substringMatch(CharSequence str, int index, CharSequence substring) { for (int j = 0; j < substring.length(); j++) { int i = index + j; if (i >= str.length() || str.charAt(i) != substring.charAt(j)) { return false; }/*from w w w . j av a2 s .c o m*/ } return true; } }