Navigation
Synopsis Convert a set to a string.
Function str toString(set[&T] st)
Usage import Set;
Examples
rascal>import Set;
ok
rascal>toString({1, 2, 3});
str: "{1,2,3}"
rascal>toString({"elephant", "zebra", "snake"});
str: "{\"snake\",\"zebra\",\"elephant\"}"
Pitfalls Recall that the elements of a set are unordered and that there is no guarantee in which order the set elements will be placed in the resulting string.

Questions
Question [1].
The type of toString({16}) is

Question [2].
toString() == "{13,-18,-17,-12,-9}"



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.