RPTools

Personal tools
From MapToolDoc

lastIndexOf

lastIndexOf() Function

Introduced in version 1.3b48

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

  1. lastIndexOf(str, substr)

Example

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

Returns 2

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

Returns -1