Returns the index of the first item that matches the predicate.
public static int FindIndex<T>(this IReadOnlyList<T> list, Func<T, bool> match)
parameter | description |
---|---|
list | The list. |
match | The delegate that defines the conditions of the element to search for. |
Returns the index of the first item that matches the predicate.
public static int FindIndex<T>(this IReadOnlyList<T> list, int startIndex, Func<T, bool> match)
parameter | description |
---|---|
list | The list. |
startIndex | The zero-based starting index of the search. |
match | The delegate that defines the conditions of the element to search for. |
The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1.