FirstConsecutiveWhere Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Finds the first occurence of count consecutive items in the list for which a given predicate returns true.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static int FirstConsecutiveWhere<T>(
	IList<T> list,
	int count,
	Predicate<T> predicate
)
Visual Basic (Declaration)
Public Shared Function FirstConsecutiveWhere(Of T) ( _
	list As IList(Of T), _
	count As Integer, _
	predicate As Predicate(Of T) _
) As Integer
Visual C++
public:
generic<typename T>
static int FirstConsecutiveWhere (
	IList<T>^ list, 
	int count, 
	Predicate<T>^ predicate
)

Parameters

list
IList<(Of <T>)>
The list to examine.
count
Int32
The number of consecutive items to look for. The count must be at least 1.
predicate
Predicate<(Of <T>)>
The predicate used to test each item.

Return Value

The index of the first item in the first run of count items where predicate returns true for all items in the run, or -1 if no such run exists.

Type Parameters

T

See Also