String.lastIndexOfString()

Signature

int lastIndexOfString (String s1, int fromIndex, String s2)

Domain

ACTION, CONDITION, QUERY, BUI

Description

Finds the index of the last occurrence of s2 within s1 that is at, or after, fromIndex.

Parameters

NameTypeDescription
s1StringA String to search.
fromIndexintA position within s1.
s2StringA String to find within s1.

Returns

TypeDescription
intThe index within the String s1 of the last occurrence of the String s2.

Cautions

none

Example

int result = String.lastIndexOfString("This is a test. This is a test.", 3, "is ");

Result is: 21