splitAfter method

String splitAfter(
  1. Pattern pattern
)

Splits from a pattern and returns remaining String after that

Implementation

String splitAfter(Pattern pattern) {
  ArgumentError.checkNotNull(pattern, 'pattern');
  var matchIterator = pattern.allMatches(this!).iterator;

  if (matchIterator.moveNext()) {
    var match = matchIterator.current;
    var length = match.end - match.start;
    return this.validate().substring(match.start + length);
  }
  return '';
}