json.count
json.count() Function
• Introduced in version 1.3b53
Returns the number of occurrences of a value in a JSON Array. If the value does
not occur in the JSON Array then -1
is returned. The index for the JSON Array
Usage
[h: jarr = json.count(jarr, value)]
[h: jarr = json.count(jarr, value, startIndex)]
Parameters
jarr
- The JSON Array to search.value
- The value to count the occurrences of.startIndex
- The index to start searching from, if not specified it defaults to 0.
Example
[r: json.count("[1,2,3,1,1,3]", 1)]
[r: json.count("[1,2,3,1,1,3]", 1, 1)]
Returns 2
3