Click or drag to resize

duplicatesDuplicatesSortedT Method

Namespace:  WhetStone.Looping
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static IEnumerable<T> DuplicatesSorted<T>(
	this IEnumerable<T> arr,
	IEqualityComparer<T> comp = null,
	int minoccurances = 2
)

Parameters

arr
Type: System.Collections.GenericIEnumerableT
The sorted IEnumerableT to filter.
comp (Optional)
Type: System.Collections.GenericIEqualityComparerT
The IEqualityComparerT to use to compare elements. will use the default IEqualityComparerT
minoccurances (Optional)
Type: SystemInt32
The minimum number of times an element must appear in order to not be filtered out.

Type Parameters

T
The type of the IEnumerableT.

Return Value

Type: IEnumerableT
A filtered IEnumerableT with only elements in arr that appear at least minoccurances times.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

arr doesn't have to be sorted, it just has to have all elements equal to each other adjacent.

Alternately, all non-adjacent equal elements will be treated as non-equal.

See Also