ImmutableArrayExtensions.Last 方法

定义

重载

Last<T>(ImmutableArray<T>)

返回集合中的最后一个元素。Returns the last element in the collection.

Last<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足指定条件的最后一个元素。Returns the last element of a sequence that satisfies a specified condition.

Last<T>(ImmutableArray<T>)

返回数组的最后一个元素。Returns the last element of the array.

Last<T>(ImmutableArray<T>)

返回集合中的最后一个元素。Returns the last element in the collection.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T Last(System::Collections::Immutable::ImmutableArray<T>::Builder ^ builder);
public static T Last<T> (this System.Collections.Immutable.ImmutableArray<T>.Builder builder);
static member Last : System.Collections.Immutable.ImmutableArray<'T>.Builder -> 'T

类型参数

T

生成器中的项类型。The type of item in the builder.

参数

builder
ImmutableArray<T>.Builder

要从中检索元素的生成器。The builder to retrieve elements from.

返回

T

生成器中的最后一个元素。The last element in the builder.

异常

在集合为空时引发。Thrown if the collection is empty.

Last<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足指定条件的最后一个元素。Returns the last element of a sequence that satisfies a specified condition.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T Last(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, bool> ^ predicate);
public static T Last<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,bool> predicate);
static member Last : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, bool> -> 'T
<Extension()>
Public Function Last(Of T) (immutableArray As ImmutableArray(Of T), predicate As Func(Of T, Boolean)) As T

类型参数

T

集合包含的元素的类型。The type of element contained by the collection.

参数

immutableArray
ImmutableArray<T>

要从中检索元素的数组。The array to retrieve elements from.

predicate
Func<T,Boolean>

委托,用于定义要检索的元素的条件。The delegate that defines the conditions of the element to retrieve.

返回

T

数组中满足 predicate 条件的最后一个元素。The last element of the array that satisfies the predicate condition.

异常

在集合为空时引发。Thrown if the collection is empty.

Last<T>(ImmutableArray<T>)

返回数组的最后一个元素。Returns the last element of the array.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T Last(System::Collections::Immutable::ImmutableArray<T> immutableArray);
public static T Last<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray);
static member Last : System.Collections.Immutable.ImmutableArray<'T> -> 'T
<Extension()>
Public Function Last(Of T) (immutableArray As ImmutableArray(Of T)) As T

类型参数

T

数组包含的元素的类型。The type of element contained by the array.

参数

immutableArray
ImmutableArray<T>

要从中检索项的数组。The array to retrieve items from.

返回

T

数组中的最后一个元素。The last element in the array.

异常

在集合为空时引发。Thrown if the collection is empty.

适用于