OCLOperators Set
m ((username removed) (log details removed): Moving to Documentation namespace)
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<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.  


Line 7: Line 8:
'''With Strings:'''
'''With Strings:'''
  Set{'String', 'EmailAddress'}->collect(s| DoSomthingWithAString(s))
  Set{'String', 'EmailAddress'}->collect(s| DoSomthingWithAString(s))
If you want to create a sequence of numbers (in order), you can use the [[OCLOperators Sequence]].
If you want to create a sequence of numbers (in order), you can use the [[Documentation:OCLOperators Sequence|OCLOperators Sequence]].


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


See also: [[OCLOperators Bag]]
'''See also:''' [[Documentation:OCLOperators Bag|OCLOperators Bag]]
[[Category:OCLOperators]]
[[Category:OCLOperators]]
{{Edited|July|12|2025}}

Latest revision as of 05:48, 4 February 2025

This page was created by Hans.karlsen@mdriven.net on 2017-11-08. Last edited by Stephanie@mdriven.net on 2025-02-04.

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