Function Reference
— Function File: index (s, t)
— Function File: index (s, t, direction)

Return the position of the first occurrence of the string t in the string s, or 0 if no occurrence is found. For example,

          index ("Teststring", "t")
                4

If direction is ‘"first"’, return the first element found. If direction is ‘"last"’, return the last element found. The rindex function is equivalent to index with direction set to ‘"last"’.

Caution: This function does not work for arrays of character strings.

See also: find rindex