Delivers the position of the last occurrence of the character string sub in the original. If the character string sub is not contained in the original the return value is: -1.
lastIndexOf(String sub) | ||||
---|---|---|---|---|
Argument | String | sub | ||
Return value | Integer | New position of the last occurrence of the character string sub in the original. If the character string sub is not contained in the original the return value is: -1. |
Formula | Result |
---|---|
='abcdabcd'.lastIndexOf('cd') | 6 |