String trimLeading(String pattern, String from) { int i = 0; while (from.startsWith(pattern, i)) { i += pattern.length; } return from.substring(i); }