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;
    }
  }
  return true;
}

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 ; } } return true ; }
test whether the given string matches the given substring at the given index .
