Click or drag to resize

count.Count<T> Method (IEnumerable<T>, T, IEqualityComparer<T>)

Counts the number of times target appears in this.

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

Parameters

this
Type: System.Collections.Generic.IEnumerable<T>
The IEnumerable< T> to count from.
target
Type: T
The element, whose appearances in this are to be counted.
comp (Optional)
Type: System.Collections.Generic.IEqualityComparer<T>
The IEqualityComparer< T> to use to equate this's elements to target. will set to default IEqualityComparer<T>.

Type Parameters

T
The type of this.

Return Value

Type: Int32
The number of elements in this that are equal to target by comp.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<T>. 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).
See Also