ImmutableArrayExtensions.Select<T,TResult>(ImmutableArray<T>, Func<T,TResult>) 方法

定义

将序列中的每个元素投影到新表单。Projects each element of a sequence into a new form.

public:
generic <typename T, typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<TResult> ^ Select(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, TResult> ^ selector);
public static System.Collections.Generic.IEnumerable<TResult> Select<T,TResult> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,TResult> selector);
static member Select : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, 'Result> -> seq<'Result>
<Extension()>
Public Function Select(Of T, TResult) (immutableArray As ImmutableArray(Of T), selector As Func(Of T, TResult)) As IEnumerable(Of TResult)

类型参数

T

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

TResult

结果元素的类型。The type of the result element.

参数

immutableArray
ImmutableArray<T>

要从中选择项的不可变数组。The immutable array to select items from.

selector
Func<T,TResult>

应用于每个元素的转换函数。A transform function to apply to each element.

返回

IEnumerable<TResult>

一个 IEnumerable<T>,其元素为对源的每个元素调用转换函数的结果。An IEnumerable<T> whose elements are the result of invoking the transform function on each element of source.

适用于