ImmutableArray<T>.OfType<TResult> 方法

定义

筛选此数组的元素,以仅显示可分配给指定类型的元素。Filters the elements of this array to those assignable to the specified type.

public:
generic <typename TResult>
 System::Collections::Generic::IEnumerable<TResult> ^ OfType();
public System.Collections.Generic.IEnumerable<TResult> OfType<TResult> ();
member this.OfType : unit -> seq<'Result>
Public Function OfType(Of TResult) () As IEnumerable(Of TResult)

类型参数

TResult

筛选序列元素所根据的类型。The type to filter the elements of the sequence on.

返回

IEnumerable<TResult>

一个 IEnumerable,其中包含类型为 TResult 的输入序列中的元素。An IEnumerable that contains elements from the input sequence of type of TResult.

适用于