String.lastIndexOfString()
Signature
int lastIndexOfString (String s1, int fromIndex, String s2)
Domain
action, condition, query
Description
Returns the index within the String s1
of the
last occurrence of the String s2
.
Parameters
Name | Type | Description |
s1 | String | A String to search. |
fromIndex | int | The index within s1 to begin the search. |
s2 | String | A String to search for within the String 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 test", 4, "test");
Result is:
result contains: 16.