afterFirst method

String afterFirst(
  1. String string
)

Get the substring of a string after the first occurrence of a string.

Implementation

String afterFirst(String string) {
  if (this == null) {
    throw ArgumentError('string: $this');
  }
  if (this!.isEmpty) {
    return '';
  }
  final index = this!.indexOf(string);
  if (index == -1) {
    return '';
  }
  return this!.substring(index + string.length);
}