String.indexOfString()
Signature
int indexOfString (String s1, int fromIndex, String s2)
Domain
ACTION, CONDITION, QUERY, BUI
Description
Finds the index of the first 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 | Returns the index of the first occurrence of s2 within s1 that is at, or after, fromIndex, if there is one. Else returns -1. |
Example
int result = String.indexOfString("This is a test. This is a test.", 3, "is ");
Result is: 5