AlgorithmsEqualCollectionsT Method (IEnumerableT, IEnumerableT) |
Determines if the two collections contain equal items in the same order. The two collections do not need
to be of the same type; it is permissible to compare an array and an OrderedBag, for instance.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static bool EqualCollections<T>(
IEnumerable<T> collection1,
IEnumerable<T> collection2
)
public:
generic<typename T>
static bool EqualCollections(
IEnumerable<T>^ collection1,
IEnumerable<T>^ collection2
)
Parameters
- collection1
- Type: System.Collections.GenericIEnumerableT
The first collection to compare. - collection2
- Type: System.Collections.GenericIEnumerableT
The second collection to compare.
Type Parameters
- T
- The type of items in the collections.
Return Value
Type:
BooleanTrue if the collections have equal items in the same order. If both collections are empty, true is returned.
RemarksThe default sense of equality for T is used, as defined by T's
implementation of IComparable<T>.Equals or object.Equals.
See Also