OCLOperators difference
No edit summary
No edit summary
Line 21: Line 21:
  = 'g'
  = 'g'
[[File:2019-11-25 13h27 03.png|none|thumb]]See: [[Examples_on_collection_operators]]
[[File:2019-11-25 13h27 03.png|none|thumb]]See: [[Examples_on_collection_operators]]
In linq this might can achieved with "reject"
[[Category:OCLOperators]]
[[Category:OCLOperators]]
[[Category:OCL Collection Operators]]
[[Category:OCL Collection Operators]]

Revision as of 13:58, 14 April 2023

The difference between 2 collections: collection2 subtracted from collection1.

Example: for A,B,C,D and B,C,D,E,F the difference is A.

Set{'a','b','c','d'}->difference(Set{'b','c','d','e'})
= 'a'

Set{'a','b','c','d','e'}->difference(Set{'b','c','d','e'})
= 'a'

Set{'a','b','c','d','e','f'}->difference(Set{'b','c','d','e'})
='a','f'
Set{'a','b','c','d','e','f'}->difference(Set{'a','b','c','d','e','f'})
= empty
Set{'a','b','c','d','e','f'}->difference(Set{'a','b','c','d','e','f','g'})
= empty
Set{'a','b','c','d','e','f','g'}->difference(Set{'a','b','c','d','e','f'})
= 'g'
2019-11-25 13h27 03.png

See: Examples_on_collection_operators

In linq this might can achieved with "reject"

This page was edited 87 days ago on 02/10/2024. What links here