[This is preliminary documentation and is subject to change.]
Gets last item in collection
Namespace: Tools.CollectionsT.GenericTAssembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)
Syntax
| C# |
|---|
public static T Last<T>(
this IList<T> Collection
)
|
| F# |
|---|
static member Last :
Collection:IList<'T> -> 'T
|
| JScript |
|---|
JScript does not support generic types or methods. |
Type Parameters
- T
- Type of items in collection
Return Value
Last item in
Collection (item at highest index), or null if
Collection is empty
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IList<(Of <(<'T>)>)>. When you use instance method syntax to call this method, omit the first parameter. For more information, see
or
.
Exceptions
See Also