allAfter method
Searches the string for the first occurrence of a pattern
and returns
everything after that occurrence.
Returns ''
if no occurrences were found.
Example:
'value=1'.allAfter('='); // '1'
'i like turtles'.allAfter('like') // ' turtles'
'i like cats'.allAfter(RegExp('\\s+')) // 'like cats'
Implementation
String allAfter(Pattern pattern) {
final matchIterator = pattern.allMatches(this!).iterator;
if (matchIterator.moveNext()) {
final match = matchIterator.current;
final length = match.end - match.start;
return this!.substring(match.start + length);
}
return '';
}