Wintellect.PowerCollections Namespace
Algorithms Class
Algorithms Methods
GhostDoc Pro Sample Help File

Algorithms..::..FirstIndexOf<(Of <(<'T>)>)> Method (IList<(Of <(<'T>)>)>, T)

Finds the index of the first item in a list equal to a given item.

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

Syntax


public static int FirstIndexOf<T>(
	IList<T> list,
	T item
)
Public Shared Function FirstIndexOf(Of T) ( _
	list As IList(Of T), _
	item As T _
) As Integer
public:
generic<typename T>
static int^ FirstIndexOf(
	IList<T>^ list, 
	T item
)

Type Parameters

T

Parameters

list
Type: IList<(Of <(<'T>)>)>
The list to search.
item
Type: T
The item to search for.

Return Value

The index of the first item equal to item. -1 if no such item exists in the list.

Remarks


The default sense of equality for T is used, as defined by T's implementation of IComparable<T>.Equals or object.Equals.