WOLFRAM

ContainsAll[list1,list2]

yields True if list1 contains all of the elements of list2.

ContainsAll[list2]

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

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

The first list contains all elements of the second list:

The first list does not contain all elements of the second list:

Scope  (4)Survey of the scope of standard use cases

The English word facetious contains all five vowels:

Use ContainsAll in operator form:

Find the movies whose cast contains both Angelina Jolie and Brad Pitt:

ContainsAll works with associations:

Options  (2)Common values & functionality for each option

SameTest  (2)

By default, ContainsAll 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  (4)Sample problems that can be solved with this function

Randomly find 10 English words containing all five vowels:

Find the shortest French word containing all five vowels:

Take the first character of each word of a text:

It does not contain words starting with all letters of the alphabet:

This larger text does contain words starting with all letters of the alphabet:

All of them do not appear as capital first letters in the text:

A pangrammatic lipogram is a text that uses all letters of the alphabet except one:

Properties & Relations  (3)Properties of the function, and connections to other functions

ContainsAll[list1,list2] is equivalent to SubsetQ[list1,list2]:

Reversing the arguments of ContainsAll is equivalent to using ContainsOnly:

ContainsAll[list,{}] always returns True:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2025_containsall, author="Wolfram Research", title="{ContainsAll}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/ContainsAll.html}", note=[Accessed: 06-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_containsall, organization={Wolfram Research}, title={ContainsAll}, year={2015}, url={https://reference.wolfram.com/language/ref/ContainsAll.html}, note=[Accessed: 06-June-2025 ]}