ImmutableArrayExtensions.First 方法

定义

重载

First<T>(ImmutableArray<T>)

返回数组中的第一个元素。Returns the first element in an array.

First<T>(ImmutableArray<T>)

返回集合中的第一个元素。Returns the first element in the collection.

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

返回序列中满足指定条件的第一个元素。Returns the first element in a sequence that satisfies a specified condition.

First<T>(ImmutableArray<T>)

返回数组中的第一个元素。Returns the first element in an array.

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

类型参数

T

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

参数

immutableArray
ImmutableArray<T>

要从中获取项的数组。The array to get an item from.

返回

T

数组中的第一个项。The first item in the array.

异常

如果数组为空。If the array is empty.

First<T>(ImmutableArray<T>)

返回集合中的第一个元素。Returns the first element in the collection.

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

类型参数

T

数组中项的类型。The type of items in the array.

参数

builder
ImmutableArray<T>.Builder

要从中检索项的生成器。The builder to retrieve an item from.

返回

T

列表中的第一个项。The first item in the list.

异常

如果数组为空。If the array is empty.

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

返回序列中满足指定条件的第一个元素。Returns the first element in a sequence that satisfies a specified condition.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T First(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, bool> ^ predicate);
public static T First<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,bool> predicate);
static member First : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, bool> -> 'T
<Extension()>
Public Function First(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 get an item from.

predicate
Func<T,Boolean>

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

返回

T

列表中的第一个项(如果该项满足 predicate 指定的条件)。The first item in the list if it meets the condition specified by predicate.

异常

如果数组为空。If the array is empty.

适用于