string last

string last string1 string2 ?lastIndex?

Search string2 for a sequence of characters that exactly match the characters in string1. If found, return the index of the first character in the last such match within string2. If there is no match, then return -1. If lastIndex is specified (in any of the forms accepted by the index method), then only the characters in string2 at or before the specified lastIndex will be considered by the search. For example,

   string last a 0a23456789abcdef 15

will return 10, but

   string last a 0a23456789abcdef 9

will return 1.

See also: