Caché MultiValue Basic Reference
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   

Returns the starting position of a substring for each element of a dynamic array.
dynarray A dynamic array of elements to be searched for substring. An expression that resolves to a dynamic array.
substring An expression that resolves to a substring to locate within string.
occurs An expression that resolves to a positive integer specifying which occurrence of substring to locate.
The INDEXS function returns a dynamic array of integers, each integer element containing the starting character position, counting from 1, of substring within the corresponding dynarray element. Matching of substring is case-sensitive. You use the occurs argument to specify which occurrence of substring to return the location of.
INDEXS returns 0 for a dynamic array element for any of the following:
If occurs is a mixed numeric string, the numeric part is parsed until a non-numeric character is encountered. Thus “7dwarves” is parsed as 7.
See Also