private static boolean substringStartsWith(String string, int offset, String substring) {
    return string.regionMatches(offset, substring, 0, substring.length());
  }
private static boolean substringStartsWith ( String string , int offset , String substring ) { return string . regionMatches ( offset , substring , 0 , substring . length ( ) ) ; }
Returns true if {@code string.substring(offset).startsWith(substring)}.