ListExtensions.IndexOf<T>

Extension Method in ListExtensions

Declaration

public static int IndexOf<T>(this List<T> list, Predicate<T> predicate)

Description

Returns the index of the first item in the list that satisfies the predicate.

Type Parameters

TThe type of the list.

Parameters

listThe list to search in.
predicateThe predicate to use.

Returns

intThe index of the item, or -1 if not found.