Newer Version Available

This content describes an older version of this product. View Latest

index_of()

Returns the location (index) of the specified characters.

Syntax

index_of(string, searchStr [,position [, occurence]])

Usage

This function returns the index of searchStr in string, beginning at the specified position. The function returns 0 if searchStr is not found. This function is case-sensitive. If any of the parameters are null, then the function returns null.

The default value of position is 1, which means that the function begins searching at the first character of string. An error results if position is negative or zero.

occurrence is an optional integer, with a default value of 1 . You can use this parameter to specify which occurrence of searchStr to search for. For example, if there is more than one occurrence of searchStr, and occurence is 2, the index of the second occurrence is returned.

Constant values are supported for position and occurrence, not arbitrary expressions.

If searchStr is an empty string, then the function returns null.

Example