ContainsAll
✖
ContainsAll
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

- In ContainsAll[list1,list2], the listi must be lists of expressions, or representations of them, namely objects with heads like SparseArray, QuantityArray, Association or EntityClass.
- ContainsAll[list1,list2,SameTesttest] applies test to each pair of elements in the listi to determine whether they should be considered the same.
- ContainsAll[list2][list1] is equivalent to ContainsAll[list1,list2].
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases
The English word facetious contains all five vowels:

https://wolfram.com/xid/0b8cmi3k0k-3nq2i7

Use ContainsAll in operator form:

https://wolfram.com/xid/0b8cmi3k0k-x9e6py


https://wolfram.com/xid/0b8cmi3k0k-zib13t


https://wolfram.com/xid/0b8cmi3k0k-24q7zq

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

https://wolfram.com/xid/0b8cmi3k0k-c9ctfn

ContainsAll works with associations:

https://wolfram.com/xid/0b8cmi3k0k-swyq31


https://wolfram.com/xid/0b8cmi3k0k-dktprb

Options (2)Common values & functionality for each option
SameTest (2)
By default, ContainsAll considers elements to be the same if they are identical:

https://wolfram.com/xid/0b8cmi3k0k-va3try


https://wolfram.com/xid/0b8cmi3k0k-m67or7

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

https://wolfram.com/xid/0b8cmi3k0k-jtl0vb

Numerical approximations are not considered as the same object:

https://wolfram.com/xid/0b8cmi3k0k-t34h5h

Use Equal as the comparison function to have numerical tolerance:

https://wolfram.com/xid/0b8cmi3k0k-gz6vvk

String comparisons are case sensitive by default:

https://wolfram.com/xid/0b8cmi3k0k-1pybm9

Convert to lower case before comparing:

https://wolfram.com/xid/0b8cmi3k0k-3b2q37

Applications (4)Sample problems that can be solved with this function
Randomly find 10 English words containing all five vowels:

https://wolfram.com/xid/0b8cmi3k0k-hi6z71

Find the shortest French word containing all five vowels:

https://wolfram.com/xid/0b8cmi3k0k-ga3kg9

Take the first character of each word of a text:

https://wolfram.com/xid/0b8cmi3k0k-vq29ss

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

https://wolfram.com/xid/0b8cmi3k0k-4qg1r6


https://wolfram.com/xid/0b8cmi3k0k-oah1fa

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

https://wolfram.com/xid/0b8cmi3k0k-vq4pri


https://wolfram.com/xid/0b8cmi3k0k-e4gyzg

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

https://wolfram.com/xid/0b8cmi3k0k-s8j5kl

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

https://wolfram.com/xid/0b8cmi3k0k-d69o0v

https://wolfram.com/xid/0b8cmi3k0k-57u7r4

Properties & Relations (3)Properties of the function, and connections to other functions
ContainsAll[list1,list2] is equivalent to SubsetQ[list1,list2]:

https://wolfram.com/xid/0b8cmi3k0k-y6exib

https://wolfram.com/xid/0b8cmi3k0k-xyoj5b

https://wolfram.com/xid/0b8cmi3k0k-2gp42t

Reversing the arguments of ContainsAll is equivalent to using ContainsOnly:

https://wolfram.com/xid/0b8cmi3k0k-2upf1i

https://wolfram.com/xid/0b8cmi3k0k-py8oi3

https://wolfram.com/xid/0b8cmi3k0k-ehhrdi

ContainsAll[list,{}] always returns True:

https://wolfram.com/xid/0b8cmi3k0k-2qq8ei


https://wolfram.com/xid/0b8cmi3k0k-dsy59k

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.
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.
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
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: 20-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: 20-June-2025
]}