CoCoA:Count

From ApCoCoAWiki

Count

count the objects in a list

Description

This function counts the number of occurrences of the object E in the

list L.

Example

  L := [1,2,3,2,[2,3]];
  Count(L,2);
2
-------------------------------
  Count(L,[2,3]);
1
-------------------------------
  Count(L,<quotes>a</quotes>);
0
-------------------------------

Syntax

Count(L:LIST,E:OBJECT):INT

Distrib

Len

   <type>list</type>