Mwnci ucount() Function

Syntax

ucount(array)

Description

The ucount() function returns a hash containing the array elements as the key, and a count of how many times the key is present in the array

Example

a=[1,2,3,1,2,3,4,5,6,100]
println(ucount(a))
b=["eccles", "eccles", "neddie", "bluebottle", "bluebottle", "moriarty"]
println(ucount(b))


{"2": 2, "3": 2, "4": 1, "5": 1, "6": 1, "100": 1, "1": 2}
{"neddie": 1, "bluebottle": 2, "moriarty": 1, "eccles": 2}