Method Array.count()
- Method
count
intcount(array|mapping|multisethaystack,mixedneedle)
mapping(mixed:int) count(array|mapping|multisethaystack)- Description
Returns the number of occurrences of
needleinhaystack. If the optionalneedleargument is omitted, count instead works similar to the unix command sort|uniq -c, returning a mapping with the number of occurrences of each element inhaystack. For array or mappinghaystacks, it's the values that are counted, for multisets the indices, as you'd expect.- See also