public static boolean match(final String string,final int offset,final String query){
  if (string.length() - offset < query.length())   return false;
  for (int i=0; i < query.length(); i++) {
    if (string.charAt(offset + i) != query.charAt(i))     return false;
  }
  return true;
}

public static boolean match ( final String string , final int offset , final String query ) { if ( string . length ( ) - offset < query . length ( ) ) return false ; for ( int i = 0 ; i < query . length ( ) ; i ++ ) { if ( string . charAt ( offset + i ) != query . charAt ( i ) ) return false ; } return true ; }
does the query match the string starting at the offset
