Name
lastIndexOf() — NN 2 IE J1 ECMA 1
Synopsis
lastIndexOf(searchString[,startPositionIndex])
Returns a zero-based integer of the position within the current
string object where the searchString
parameter starts. This method works like the
indexOf() method but begins all searches from the
end of the string or some index position. Even though searching
starts from the end of the string, the
startPositionIndex parameter is based on
the start of the string, as is the returned value. If there is no
match, the returned value is -1.
Returned Value
Integer.
Parameters
-
searchString A string to look for in the current string object.
-
startPositionIndex A zero-based integer indicating the position within the current string object to begin the search of the first parameter. Even though the search starts from the end of the string, this parameter value is relative to the front of the string.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access