This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Complement

Complement
gives the elements in which are not in any of the .
  • The list returned by Complement is sorted into standard order.
  • Complement[eall, e1, ..., SameTest->test] applies test to each pair of elements in and the to determine whether they should be considered the same.
Find which elements in the first list are not in any of the subsequent lists:
Find which elements in the first list are not in any of the subsequent lists:
In[1]:=
Click for copyable input
Out[1]=
Complement works with any head, not just List:
Find divisors of 20 that are not also divisors of 12:
Find which triples of digits do not occur in the binary decomposition of 12345:
Find which options to Plot are not also options to Graphics:
Find which length-5 sequences never occur after 2 steps in any elementary cellular automaton:
New in 1 | Last modified in 3