Set::difference Method [AX 2012]
Calculates and retrieves the set containing the elements from set1 that are not found in set2.
The following example creates one set that contains the integers 1, 2, and 3, and one set that contains the integers 2 and 4. The difference method is used to create a set that contains the elements in the first set that are not in the second set (1 and 3).
{
Set is = new Set (Types::Integer);
Set is2, is1 = new Set (Types::Integer);
;
is.add(1);
is.add(2);
is.add(3);
is1.add(2);
is1.add(4);
is2 = Set::difference(is, is1);
// prints "{1, 3}"
print is2.toString();
pause;
}
Show: