lastIndexOf( substring, index )
The character position in the string at which the substring was found. If the substring is not found the return value is -1.
substring – the substring to search for in the string. Substring can be a string or a variable name containing a string. Substring should be surrounded by quotes if it is a string. This parameter is required.
index – the index position to start searching from. Index can be a number or a variable containing a number. Index is a zero-based index. This parameter is optional and will start at the end of the string if not entered.
This function will search for the substring starting at the end of the string (or the index position you specifed) and work towards the beginning of the string.