INDEX

Syntax: scalar = INDEX(string1,string2)

The INDEX function accepts two strings as arguments. If string2 is a subset of string1, it returns the substring's starting position. If string2 occurs more than once in string1, the starting position of the first (leftmost) occurrence is returned. If string2 does not occur in string1, the value zero (0) is returned. Neither string argument will be modified.

Examples

function result
INDEX('abc','abc') 1
INDEX('abcd','abc') 1
INDEX('abc','abcd') 0
INDEX('xxabcabc','abc') 3