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
Name | Type | Description |
s1 | String | A String to search. |
fromIndex | int | A position within s1 . |
s2 | String | A String to find within s1 . |
Returns
Type | Description |
int | The index within the String s1 of the
last occurrence of the String s2 . |
Example
int result = String.lastIndexOfString("This is a test. This is a test.", 3, "is ");
Result is: 21