DisjointQ

DisjointQ[list1,list2]
yields True if and do not share any common elements, and False otherwise.

DetailsDetails

  • DisjointQ works for expressions with heads other than List.
  • When applied to associations, DisjointQ compares their values.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Test whether lists share no elements:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2014
(10.0)
Translate this page: