replaceBeforeFirst method
Replaces everything before the first occurrence of pattern.
Implementation
String replaceBeforeFirst(String pattern, String replacement) {
final i = indexOf(pattern);
if (i == -1) return this;
return replacement + substring(i);
}