AlgorithmsRemoveDuplicatesT Method (IEnumerableT, IEqualityComparerT) |
Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items
in the collection, all items after the first item in the run are removed. A passed
IEqualityComparer is used to determine equality.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IEnumerable<T> RemoveDuplicates<T>(
IEnumerable<T> collection,
IEqualityComparer<T> equalityComparer
)
public:
generic<typename T>
static IEnumerable<T>^ RemoveDuplicates(
IEnumerable<T>^ collection,
IEqualityComparer<T>^ equalityComparer
)
Parameters
- collection
- Type: System.Collections.GenericIEnumerableT
The collection to process. - equalityComparer
- Type: System.Collections.GenericIEqualityComparerT
The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.RemoveDuplicates``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEqualityComparer{``0})"]
Return Value
Type:
IEnumerableTAn new collection with the items from
collection, in the same order,
with consecutive duplicates removed.
Exceptions
See Also