ContainsExactly

ContainsExactly[list1,list2]

yields True if list1 contains exactly the same elements as list2.

ContainsExactly[list2]

is an operator form that yields True when the object to which it is applied contains exactly the same elements as list2.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Both lists contain exactly the same elements:

The lists contain different elements:

Scope  (4)

Check whether certain chemicals contain exactly certain elements:

Use ContainsExactly in operator form:

Find music works composed in 1982 by Bernie Taupin and Elton John:

ContainsExactly works with associations:

Options  (2)

SameTest  (2)

By default, ContainsExactly 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  (1)

Two anagram words or phrases contain the same letters:

The word "parsley" is an anagram of the word "replays":

These two phrases contain the same letters:

Properties & Relations  (3)

ContainsExactly[list1,list2] is equivalent to testing for equality as sets:

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

ContainsExactly[list1,list2] is equivalent to And[ContainsAll[list1,list2],ContainsOnly[list1,list2]]:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

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