INDEX_OF¶
Description¶
INDEX_OF returns the zero-based index of the first occurrence of a value in a list or string. If the value is not found, it returns -1.
Syntax¶
Returns: An integer index, or -1 if not found.
Example with a list¶
This returns 1, since 'green' is at index 1 (zero-based).
Example with a string¶
This returns 6, the position where 'World' begins.
Example when not found¶
This returns -1.