Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
ToImmutableArray<T>(ReadOnlySpan<T>) |
Produce an immutable array of contents from specified elements. |
ToImmutableArray<T>(Span<T>) |
Converts the span to an immutable array. |
ToImmutableArray<TSource>(IEnumerable<TSource>) |
Creates an immutable array from the specified collection. |
ToImmutableArray<TSource>(ImmutableArray<TSource>.Builder) |
Creates an immutable array from the current contents of the builder's array. |
Produce an immutable array of contents from specified elements.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableArray<T> ToImmutableArray(ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableArray<T> ToImmutableArray<T>(this ReadOnlySpan<T> items);
static member ToImmutableArray : ReadOnlySpan<'T> -> System.Collections.Immutable.ImmutableArray<'T>
<Extension()>
Public Function ToImmutableArray(Of T) (items As ReadOnlySpan(Of T)) As ImmutableArray(Of T)
The type of element in the list.
The elements to store in the array.
An immutable array containing the items in the span.
Product | Versions |
---|---|
.NET | 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Framework | 4.6.2 (package-provided), 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
Converts the span to an immutable array.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableArray<T> ToImmutableArray(Span<T> items);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static System.Collections.Immutable.ImmutableArray<T> ToImmutableArray<T>(this Span<T> items);
public static System.Collections.Immutable.ImmutableArray<T> ToImmutableArray<T>(this Span<T> items);
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member ToImmutableArray : Span<'T> -> System.Collections.Immutable.ImmutableArray<'T>
static member ToImmutableArray : Span<'T> -> System.Collections.Immutable.ImmutableArray<'T>
<Extension()>
Public Function ToImmutableArray(Of T) (items As Span(Of T)) As ImmutableArray(Of T)
The type of element in the list.
The elements to store in the array.
An immutable array containing the items in the span.
Product | Versions |
---|---|
.NET | 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Framework | 4.6.2 (package-provided), 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
Creates an immutable array from the specified collection.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableArray<TSource> ToImmutableArray(System::Collections::Generic::IEnumerable<TSource> ^ items);
public static System.Collections.Immutable.ImmutableArray<TSource> ToImmutableArray<TSource>(this System.Collections.Generic.IEnumerable<TSource> items);
static member ToImmutableArray : seq<'Source> -> System.Collections.Immutable.ImmutableArray<'Source>
<Extension()>
Public Function ToImmutableArray(Of TSource) (items As IEnumerable(Of TSource)) As ImmutableArray(Of TSource)
The type of elements contained in items
.
The collection of objects to copy to the immutable array.
An immutable array that contains the specified collection of objects.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Framework | 4.6.2 (package-provided), 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
UWP | 10.0 |
Creates an immutable array from the current contents of the builder's array.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableArray<TSource> ToImmutableArray(System::Collections::Immutable::ImmutableArray<TSource>::Builder ^ builder);
public static System.Collections.Immutable.ImmutableArray<TSource> ToImmutableArray<TSource>(this System.Collections.Immutable.ImmutableArray<TSource>.Builder builder);
static member ToImmutableArray : System.Collections.Immutable.ImmutableArray<'Source>.Builder -> System.Collections.Immutable.ImmutableArray<'Source>
<Extension()>
Public Function ToImmutableArray(Of TSource) (builder As ImmutableArray(Of TSource).Builder) As ImmutableArray(Of TSource)
The type of elements contained in the immutable array.
The builder to create the immutable array from.
An immutable array that contains the current contents of the builder's array.
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Framework | 4.6.2 (package-provided), 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in