OCLOperators Set
(Adding message template to the top of the page)
(Replacing message template with parser tag)
 
Line 1: Line 1:
{{message|Write the content here to display this box}}
<message>Write the content here to display this box</message>
You can use Set with { } to create a set you may use to loop over.  
You can use Set with { } to create a set you may use to loop over.  



Latest revision as of 07:49, 17 June 2024

You can use Set with { } to create a set you may use to loop over.

A Set contains no duplicates. Otherwise, it's just a collection of something.

With Integers:

Set{14,22,12,53,2,11,66}->collect(i| DoSomthingWithAnInt(i))

With Strings:

Set{'String', 'EmailAddress'}->collect(s| DoSomthingWithAString(s))

If you want to create a sequence of numbers (in order), you can use the OCLOperators Sequence.

Other names for set: collection of strings, array of numbers, static array, initialize array, list of numbers.

See also: OCLOperators Bag

This page was edited 95 days ago on 06/17/2024. What links here