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

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

listValueCount Argument Reference

list string

value string

delimiters string
Default: ,

Examples sample code invoking the listValueCount function

Counts instances of 'foo' in the list

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

Expected Result: 2

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