Use this function to count the indexed components within the formatted text.
ParseListCount (String, Separator)
Parameter |
Description |
String |
Enter the formatted string you want the system to search and parse. |
Separator |
Enter the list of character separators used within the formatted text parameter. If you omit this parameter, the system uses semicolons and commas. |
The system returns the number of formatted items found within the String parameter. If the String parameter text starts with delimiter characters, those characters are skipped.
If you do not have at least a space character between delimiters, this will not be identified as a separate index item.
Note | You can use the ParseListItem function to return the text components parsed from the formatted text. |
For these examples, assume xString = "A,B;C"
value = ParseListCount(xString)
The value is 3.
value = ParseListCount(xString,";")
The value is 2. In this example the parameter overrides and assigns only a semicolon as a valid separator. Therefore, there are two items within this string.
For these examples, assume xString = ";A;,B,;C"
value = ParseListCount(xString)
The value is 3. If the formatted string starts with separator characters, these characters are skipped. Note that adjacent separators are treated as a single separation.
For these examples, assume xString = "; ,A; ,B;"
value = ParseListCount(xString)
The value is 4. Note the intervening character – a space - between some of the separator characters.
value = ParseListCount(xString,";")
The value is 2. This overrides and assigns only a semicolon as the format separator, therefore there are only two components. Also note that although there are three separators, the first one that starts the string and the final one that ends the string are also ignored.
© Copyright 2014, Oracle and/or its affiliates. All rights reserved. Legal notices.