takeLastTo method

String takeLastTo(
  1. Pattern pattern
)

Returns the string suffix after the last occurrence of pattern. If the pattern is not found return the whole string.

Implementation

String takeLastTo(Pattern pattern) {
  final index = lastIndexOf(pattern);
  if (index < 0) return substring(0);
  return substring(pattern.matchAsPrefix(this, index)!.end);
}