Method IndexOf
IndexOf<T>(IEnumerable<T>, T)
Finds the index of the first occurrence of an item in an enumerable.
public static int IndexOf<T>(this IEnumerable<T> items, T item)
Parameters
items
IEnumerable<T>The enumerable to search.
item
TThe item to find.
Returns
- int
The index of the first matching item, or -1 if the item was not found.
Type Parameters
T