ArrayExtensions.IndexOf<T>
Extension Method in ArrayExtensions
Declaration
public static int IndexOf<T>(this T[] array, T element)
where T : IEquatable<T>
Description
Returns the index of the given element in the array.
Type Parameters
T | The type of the array. |
Parameters
array | The array to search in. |
element | The element to search for. |
Returns
int | The index of the element in the array. |
Overload
Declaration
public static int IndexOf<T>(this T[] array, Predicate<T> predicate)
Description
Returns the index of the first element in the array that satisfies the predicate.
Type Parameters
T | The type of the array. |
Parameters
array | The array to search in. |
predicate | The predicate to use. |
Returns
int | The index of the element, or -1 if not found. |