String to search through
Substring to search for
Optionalposition: numberThe index at or before which the occurrence must begin. If omitted, the whole
string is searched. Negative values clamp to 0
Index of the last occurrence of searchString, or -1 if not found
This function mirrors the
lastIndexOffunction from the JavaScript Standard String object. It operates on grapheme clusters instead of UTF-16 code units.Returns the index of the last occurrence of the specified substring, or -1 if it is not found.