lastSplit method

string lastSplit(
  1. Pattern pattern
)

Returns the last element after splitting the string using the specified pattern. If the string cannot be split, it returns the original string.

Implementation

string lastSplit(Pattern pattern) => split(pattern).last;