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
- In ContainsExactly[list1,list2], the listi must be lists of expressions, or representations of them, namely objects with heads like SparseArray, QuantityArray, Association or EntityClass.
- ContainsExactly[list1,list2,SameTesttest] applies test to each pair of elements in the listi to determine whether they should be considered the same.
- ContainsExactly[list2][list1] is equivalent to ContainsExactly[list1,list2].
Examples
open allclose allBasic Examples (2)
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:
Applications (1)
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]]:
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