ContainsNone

ContainsNone[list1,list2]

yields True if list1 contains none of the elements in list2.

ContainsNone[list2]

is an operator form that yields True when the object to which it is applied contains none of the elements of list2.

Details and Options

Examples

open allclose all

Basic Examples  (2)

The first list contains none of the elements of the second list:

The first list contains elements of the second list:

Scope  (5)

There are English words containing none of the five vowels:

Use ContainsNone in operator form:

Select music works:

Find the movies directed by Pedro Almodóvar whose cast includes none of several actors:

ContainsNone works with associations:

Options  (2)

SameTest  (2)

By default, ContainsNone considers elements to be the same if they are identical:

Changes of units are taken into account, as long as they represent the exact same quantity:

Numerical approximations are not considered as the same object:

Use Equal as the comparison function to have numerical tolerance:

String comparisons are case sensitive by default:

Convert to lower case before comparing:

Applications  (2)

Take the list of words in this text:

That list of words does not contain any of these:

However, that is not true if "rabbit" is added:

A lipogram is a text that does not use a given letter:

Find the longest English word that does not contain the letter e:

Properties & Relations  (5)

ContainsNone[list1,list2] is equivalent to testing for empty intersection of the lists:

ContainsNone[list1,list2] is equivalent to DisjointQ[list1,list2]:

ContainsNone is a symmetric function of its arguments. That is, ContainsNone[list1,list2]==ContainsNone[list2,list1]:

Negation of ContainsNone[list1,list2] is equivalent to ContainsAny[list1,list2]:

ContainsNone[list,{}] always returns True:

Wolfram Research (2015), ContainsNone, Wolfram Language function, https://reference.wolfram.com/language/ref/ContainsNone.html.

Text

Wolfram Research (2015), ContainsNone, Wolfram Language function, https://reference.wolfram.com/language/ref/ContainsNone.html.

CMS

Wolfram Language. 2015. "ContainsNone." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ContainsNone.html.

APA

Wolfram Language. (2015). ContainsNone. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ContainsNone.html

BibTeX

@misc{reference.wolfram_2024_containsnone, author="Wolfram Research", title="{ContainsNone}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/ContainsNone.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_containsnone, organization={Wolfram Research}, title={ContainsNone}, year={2015}, url={https://reference.wolfram.com/language/ref/ContainsNone.html}, note=[Accessed: 22-November-2024 ]}