after method

String after(
  1. dynamic search
)

Return the remainder of a string after the first occurrence of a given value.

Parameters

Throws

Implementation

String after(dynamic search) {
  if (search is! String && search is! int) {
    throw TypeError;
  }

  search = search.toString();

  if (search.isEmpty) {
    return this;
  }

  int index = indexOf(search);
  if (index == -1) {
    return this;
  }

  return substring(index + search.length);
}