INDEX_OF
Description
Returns the zero-based index of the first occurrence of substring within string (case-sensitive). Optionally starts searching from index_optional. Returns -1 if not found.
Syntax
INDEX_OF(string, substring, index_optional) -> Integer
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| string | String | Yes | The string to search within. |
| substring | String | Yes | The substring to locate. |
| index_optional | Integer | No | The starting index for the search (zero-based). Defaults to 0. |
Examples
INDEX_OF("Status=OK", "status")
-- Returns -1.INDEX_OF("Log entry: userID=1234", "userID=")
-- Returns 11.INDEX_OF("SystemA-12345-Order-ABC", "-", 10)
-- Returns 13. Finds the first occurrence of "-" starting from index 10.