Finds index of first occurrence of some value in this list.

Namespace: Flinq
Assembly: Flinq (in Flinq.dll) Version: 1.0.2.0 (1.0.2.0)

Syntax

C#
public static int IndexOf<A>(
	this IEnumerable<A> source,
	A elem,
	IEqualityComparer<A> comparer
)

Parameters

source
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'A>)>)>
The input sequence.
elem
Type: A
The element value to search for.
comparer
Type: System.Collections.Generic..::..IEqualityComparer<(Of <(<'A>)>)>
An IEqualityComparer<A> to use to compare elements. If comparer is null, the default equality comparer, EqualityComparer<A>.Default, is used to compare elements.

Type Parameters

A
The type of the elements in the input sequence.

Return Value

Type: Int32
The index of the first element of this list that is equal (as determined by comparer) to elem, or -1, if none exists.

Usage Note

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