Complement

Complement[eall,e1,e2,]

gives the elements in eall that are not in any of the ei.

Details and Options

  • The list returned by Complement is sorted into standard order.
  • Complement[eall,e1,,SameTest->test] applies test to each pair of elements in eall and the ei to determine whether they should be considered the same.

Examples

open allclose all

Basic Examples  (1)

Find which elements in the first list are not in any of the subsequent lists:

In[1]:=
Click for copyable input
Out[1]=

Generalizations & Extensions  (1)

Options  (3)

Applications  (4)

See Also

Intersection  Union  Take  Select  DisjointQ  SubsetQ  ContainsOnly  ContainsAll

Tutorials

Introduced in 1988
(1.0)
| Updated in 1996
(3.0)