ArrayExtensions.ElementAt<T>

Extension Method in ArrayExtensions

Declaration

public static T ElementAt<T>(this T[] array, int index)

Description

Returns the element at the specified index.

Type Parameters

TThe type of the array.

Parameters

arrayThe array to search in.
indexThe index of the element to return.

Returns

TThe element at the specified index, or default(T) if the array is empty.