skipLastTo method
Returns the string prefix before the last occurrence of pattern
. If the
pattern is not found return the empty string.
Implementation
String skipLastTo(Pattern pattern) {
final index = lastIndexOf(pattern);
if (index < 0) return substring(0, 0);
return substring(0, index);
}