Click or drag to resize
AlgorithmsRemoveDuplicatesT Method (IEnumerableT, BinaryPredicateT)
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. The passed BinaryPredicate is used to determine if two items are "equal".

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static IEnumerable<T> RemoveDuplicates<T>(
	IEnumerable<T> collection,
	BinaryPredicate<T> predicate
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection to process.
predicate
Type: X3Platform.CollectionsBinaryPredicateT
The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where first is the first item in the group of "duplicate" items.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.RemoveDuplicates``1(System.Collections.Generic.IEnumerable{``0},X3Platform.Collections.BinaryPredicate{``0})"]

Return Value

Type: IEnumerableT
An new collection with the items from collection, in the same order, with consecutive "duplicates" removed.
Remarks
Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality.
See Also