lastIndexOf()

Returns the index of s within the current String of the last occurrence of s, searching backward.

Syntax

Numeric lastIndexOf(String s [, Numeric index ])
  1. s is the substring to search for.
  2. index (optional) is the byte position from which to start the search.

Usage

Returns -1 if the substring is not found.