Parameters: (String,String);
Returns: Integer;
Function to extract the index of a given element in an array of strings (csv).
The first parameter is the array string. This should use csv format. Double quote delimiters are supported but not required.
The second parameter is the search string. This can be NULL.
The elements in the array will be matched in turn with the search string, with the index of the first matcing value returned.
If the array is NULL, NULL will be returned.
If the search string is not found, NULL will be returned.
If the search string is NULL, the function will match on an empty element.
The array indexing is zero based, so a return of 0 indicates a match on the first value in the array.
The matching is case insensitive.
Example 1:
GET_ARRAY_INDEX('London,Paris,New York','Paris') Result: 1
Example 2:
GET_ARRAY_INDEX('London,Paris,New York','london') Result: 0
Example 3:
GET_ARRAY_INDEX('"London","Paris","New York"','New York') Result: 2
Comments
0 comments
Please sign in to leave a comment.