[This is preliminary documentation and is subject to change.]
Gets last item in collection
Namespace: Tools.CollectionsTAssembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)
Syntax
| C# |
|---|
public static Object Last( this IEnumerable Collection ) |
| Visual Basic |
|---|
<ExtensionAttribute> _ Public Shared Function Last ( _ Collection As IEnumerable _ ) As Object |
| Visual C++ |
|---|
[ExtensionAttribute] public: static Object^ Last( IEnumerable^ Collection ) |
| F# |
|---|
static member Last : Collection:IEnumerable -> Object |
| JScript |
|---|
public static function Last( Collection : IEnumerable ) : Object |
Parameters
- Collection
- Type: System.Collections..::..IEnumerable
Collection to obtain item from
Return Value
Last item in Collection, or null if Collection is emptyUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Remarks
This function have to iterate through whole Collection
Exceptions
| Exception | Condition |
|---|---|
| System..::..ArgumentNullException | Collection is null |