listValueCount

Counts instances of a specified value in a list.
The search is case-sensitive. For case-insensitive search use listValueNoCase.

listValueCount(list, value [, delimiters]) → returns numeric

listValueCount Argument Reference

list string
Required

value string
Required

delimiters string
Default: ,

Values:
  • ,
  • |
  • ;
  • chr(9)
  • chr(10)
  • chr(13)

Examples sample code invoking the listValueCount function


Simple Example

Counts instances of 'foo' in the list

listValueCount("foo,bar,lorem,foo,ipsum", "foo")

Expected Result: 2


Example with Custom Delimiter

Counts instances of 'foo' in the list with a custom delimiter

listValueCount("bar|foo|lorem,ipsum|me|foo,something|foo|FOO", "foo", "|")

Expected Result: 2


Fork me on GitHub