ListExtensions.ItemAt<T>

Extension Method in ListExtensions

Declaration

public static T ItemAt<T>(this List<T> list, int index)

Description

Returns the item at the specified index.

Type Parameters

TThe type of the list.

Parameters

listThe list to get the item from.
indexThe index of the item to get.

Returns

TThe item at the index, or default(T) if the list is empty.