ImmutableArrayExtensions.First Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
First<T>(ImmutableArray<T>) |
Returns the first element in an array. |
First<T>(ImmutableArray<T>.Builder) |
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>)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
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
Type Parameters
- T
The type of element contained by the collection.
Parameters
- immutableArray
- ImmutableArray<T>
The array to get an item from.
Returns
The first item in the array.
Exceptions
If the array is empty.
Applies to
First<T>(ImmutableArray<T>.Builder)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
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
<Extension()>
Public Function First(Of T) (builder As ImmutableArray(Of T).Builder) As T
Type Parameters
- T
The type of items in the array.
Parameters
- builder
- ImmutableArray<T>.Builder
The builder to retrieve an item from.
Returns
The first item in the list.
Exceptions
If the array is empty.
Applies to
First<T>(ImmutableArray<T>, Func<T,Boolean>)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
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
Type Parameters
- T
The type of element contained by the collection.
Parameters
- immutableArray
- ImmutableArray<T>
The array to get an item from.
Returns
The first item in the list if it meets the condition specified by predicate
.
Exceptions
If the array is empty.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈