ImmutableArray
Provides methods for creating an array that is immutable; meaning it cannot be changed once it is created.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Searches the sorted immutable array for a specified element using the default comparer and returns the zero-based index of the element, if it's found.
Searches a sorted immutable array for a specified element and returns the zero-based index of the element, if it's found.
Searches a sorted immutable array for a specified element and returns the zero-based index of the element, if it's found.
public static int BinarySearch<T>(this ImmutableArray<T> array, int index, int length, T value, IComparer<T> comparer)
Searches a sorted immutable array for a specified element and returns the zero-based index of the element.
Creates an empty immutable array.
Creates an immutable array that contains the specified object.
Creates an immutable array that contains the specified objects.
Creates an immutable array that contains the specified objects.
Creates an immutable array that contains the specified objects.
Creates an ImmutableArray<T> with the specified elements.
Creates an ImmutableArray<T> with the specified elements.
Creates an immutable array from the specified array of objects.
Creates an immutable array with specified objects from another array.
Creates an immutable array with the specified objects from another immutable array.
Creates a mutable array that can be converted to an ImmutableArray without allocating new memory.
Creates a mutable array that can be converted to an ImmutableArray without allocating new memory.
Creates a new ImmutableArray<T> populated with the specified items.
public static ImmutableArray<TResult> CreateRange<TSource, TResult>(ImmutableArray<TSource> items, Func<TSource, TResult> selector)
Initializes a new instance of the ImmutableArray<T> struct.
public static ImmutableArray<TResult> CreateRange<TSource, TResult>(ImmutableArray<TSource> items, int start, int length, Func<TSource, TResult> selector)
Initializes a new instance of the ImmutableArray<T> struct.
public static ImmutableArray<TResult> CreateRange<TSource, TArg, TResult>(ImmutableArray<TSource> items, Func<TSource, TArg, TResult> selector, TArg arg)
Initializes a new instance of the ImmutableArray<T> struct.
public static ImmutableArray<TResult> CreateRange<TSource, TArg, TResult>(ImmutableArray<TSource> items, int start, int length, Func<TSource, TArg, TResult> selector, TArg arg)
Initializes a new instance of the ImmutableArray<T> struct.
Produce an immutable array of contents from specified elements.
Converts the span to an immutable array.
Creates an immutable array from the specified collection.