COUNT

Description

COUNT returns the length of a list, dictionary, or string:

  • For a list, the number of elements.

  • For a dictionary, the number of key-value pairs.

  • For a string, the number of characters.

COUNT and LEN are aliases and are fully interchangeable. By convention, COUNT is used with lists and dictionaries and LEN with strings, but either works for any of the three.

Example

p is Person
COUNT(p.nationalities)

This will result in the number of nationalities that are known for Person p in the case.

Last updated

Was this helpful?