sS replaceAnyPrefix(S replacement, S s, S... prefixes) { for (S prefix : prefixes) if (startsWith(s, prefix)) ret replacement + substring(s, l(prefix)); ret s; }