2.5.4.48 Index
The Index function performs a search of a delimited text string for the substring specified by a zero-based index.
ABNF:
-
Index = val val [val [val]] sp ("2" / "3" / "4") ";INDEX():129"
Required Arguments:
Name: IndexPosition
Type: vSignedInt
An argument that specifies a zero-based index.
Name: List
Type: vString
An argument that specifies a string consisting of a list of delimited substrings. If the list begins and/or ends with Delimiter, an empty string is assumed to exist at the beginning and/or end of List, respectively. Consecutive delimiters indicate an empty string between them.
Optional Arguments:
Type: vString
An argument that specifies the delimiter that separates substrings inside List. If this argument is an empty string, the default value ";" is used.
Name: ErrorValue
Type: vString
An argument that specifies a string to be returned if Index is out of range. The default value is an empty string.
Return Value:
Type: PtgStr1
This function returns a PtgStr1 equal to the substring at the zero-based index location IndexPosition in List, which is delimited by Delimiter. If IndexPosition is less than zero or greater than or equal to the number of items in List, the function returns a PtgStr1 that specifies ErrorValue. The search is performed according to .NET globalization rules based on the LCID in the DocumentLanguage field of the Properties GlobalElement in the App XML Part of the document. For more information about .NET globalization rules, see [MSDN-ENCLOC].