Syntax
- string listCount(stringList, searchString)
Parameters
- stringList—string
- searchString—string
Returns
Returns number of occurrences of searchString in stringList.
Description
The listCount function returns the number of occurrences of searchString in the stringList. Optional: leading or trailing * in searchString are used as wildcard.
Note:
Stringlists are a series of strings stored inside one string. The elements are separated by a semicolon (";"). Each item must be followed by a semicolon, also the last one! The data type is "string", thus it is not an array as used in other scripting languages.
Related
Examples
listCount("rule;your;city;","city")
# result = 1
listCount("city;cityengine;city;", "city")
# result = 2
listCount("rule;your;city;","*y*")
# result = 2
listCount("rule;your;city;","*y")
# result = 1