@Contract(pure=true) public static boolean startsWithConcatenation(@NotNull String string,@NotNull String... prefixes){
  int offset=0;
  for (  String prefix : prefixes) {
    int prefixLen=prefix.length();
    if (!string.regionMatches(offset,prefix,0,prefixLen)) {
      return false;
    }
    offset+=prefixLen;
  }
  return true;
}

@ Contract ( pure = true ) public static boolean startsWithConcatenation ( @ NotNull String string , @ NotNull String ... prefixes ) { int offset = 0 ; for ( String prefix : prefixes ) { int prefixLen = prefix . length ( ) ; if ( ! string . regionMatches ( offset , prefix , 0 , prefixLen ) ) { return false ; } offset += prefixLen ; } return true ; }
equivalent to string . startswith ( prefixes [ 0 ] + prefixes [ 1 ] + . . . ) but avoids creating an object for concatenation .
