• This function mirrors the lastIndexOf function from the JavaScript Standard String object. It handles Unicode code points instead of UTF-16 character codes.

    Searches this string and returns the index of the last occurrence of the specified substring.

    Parameters

    • string: string

      String to search through

    • searchString: string

      Substring to search for

    • Optionalposition: number

      The index at which to begin searching. If omitted, the search begins at the end of the string. Default is undefined

    Returns number

    Index of the last occurrence of searchString found, or -1 if not found.