lastIndexOf abstract method
The starting position of the last matchpattern in this string.
Finds a match of pattern by searching backward starting atstart:
const string = 'Dartisans';print(string.lastIndexOf('a')); // 6print(string.lastIndexOf(RegExp(r'a(r|n)'))); // 6Returns -1 ifpattern could not be found in this string.
const string = 'Dartisans';print(string.lastIndexOf(RegExp(r'DART'))); // -1Ifstart is omitted, search starts from the end of the string.If supplied,start must be non-negative and not greater thanlength.
Implementation
int lastIndexOf(Pattern pattern, [int? start]);