getEverythingAfterLast method

  1. @useResult
String getEverythingAfterLast(
  1. String find
)

Returns the substringSafe after the last occurrence of find. Returns the original string if find is not found.

Implementation

@useResult
String getEverythingAfterLast(String find) {
  if (find.isEmpty) {
    return this;
  }

  final int atIndex = lastIndexOf(find);

  return atIndex == -1 ? this : substringSafe(atIndex + find.length);
}