Navigation
Synopsis Determine the number of elements in a set.
Function int size(set[&T] st)
Usage import Set;
Examples
rascal>import Set;
ok
rascal>size({1,2,3,4});
int: 4
rascal>size({"elephant", "zebra", "snake"});
int: 3
rascal>size({});
int: 0

Questions
Question [1].
size({  }) == 2

Question [2]. Create a set of the right size.
Fill in
import Set;
set[str] text = ;
and make the following true:
size(text) == 0;



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.