lastIndexOf

From RPTools Wiki
Revision as of 16:06, 6 December 2008 by Craig (talk | contribs) (New page: ==Function lastIndexOf== Finds the index in a string of the last occurrence of a substring in a string. If the substring does not occur in the string then -1 is returned. The index for th...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function lastIndexOf

Finds the index in a string of the last occurrence of a substring in a string. If the substring does not occur in the string then -1 is returned. The index for the string starts at 0.

Usage

[h: ind = lastIndexOf(string, substring)]

Example

[lastIndexOf("abcde", "c")]

Returns 2

[lastIndexOf("abcde", "z")]

Returns -1