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