ImmutableArray<T>
public struct ImmutableArray<T> : IReadOnlyList<T>, IEnumerable<T>, IEnumerable, IReadOnlyCollection<T>, IList<T>, ICollection<T>, IEquatable<ImmutableArray<T>>, IList, ICollection, IImmutableArray, IStructuralComparable, IStructuralEquatable, IImmutableList<T>
Represents 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)
public sealed class Builder<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IReadOnlyList<T>, IReadOnlyCollection<T>
A writable array accessor that can be converted into an ImmutableArray<T> instance without allocating extra memory.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
An array enumerator.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Gets an empty immutable array.
Gets a value indicating whether this array was declared but not initialized.
Gets a value indicating whether this ImmutableArray<T> is empty or is not initialized.
Gets a value indicating whether this ImmutableArray<T> is empty.
Gets the element at the specified index in the immutable array.
Gets the number of elements in the array.
Initializes a new instance of the ImmutableArray<T> struct based on the contents of an existing instance, allowing a covariant static cast to efficiently reuse the existing array.
Returns a value that indicates if two arrays are equal.
Returns a value that indicates if two arrays are equal.
Returns a value that indicates whether two arrays are not equal.
Checks for inequality between two array.
Returns a copy of the original array with the specified item added to the end.
Returns a copy of the original array with the specified elements added to the end of the array.
Returns a copy of the original array with the specified elements added to the end of the array.
Adds the specified values to this list.
Adds the specified values to this list.
Returns a new immutable array that contains the elements of this array cast to a different type.
Creates a new read-only memory region over this immutable array.
Creates a new read-only span over this immutable array.
Creates a ReadOnlySpan<T> over the portion of the current ImmutableArray<T>, beginning at a specified position for a specified length.
Creates a span over the portion of the current ImmutableArray<T> based on the specified range.
Initializes a new instance of the ImmutableArray<T> struct by casting the underlying array to an array of type TOther.
Returns an array with all the elements removed.
Determines whether the specified item exists in the array.
Copies the elements of current ImmutableArray<T> to a Span<T>.
Copies the contents of this array to the specified array.
Copies the contents of this array to the specified array starting at the specified destination index.
Copies the specified items in this array to the specified array at the specified starting index.
Indicates whether specified array is equal to this array.
Returns an enumerator that iterates through the contents of the array.
Searches the array for the specified item.
Searches the array for the specified item.
Searches the array for the specified item.
Searches the array for the specified item.
Searches the array for the specified item.
Returns a new array with the specified value inserted at the specified position.
Inserts the specified values at the specified index.
Inserts the specified values at the specified index.
Inserts the specified values at the specified index.
Inserts the specified values at the specified index.
Gets a read-only reference to the element at the specified index in the read-only list.
Searches the array for the specified item; starting at the end of the array.
Searches the array for the specified item; starting at the end of the array.
Searches the array for the specified item; starting at the end of the array.
Searches the array for the specified item; starting at the end of the array.
Filters the elements of this array to those assignable to the specified type.
Returns an array with the first occurrence of the specified element removed from the array. If no match is found, the current array is returned.
Returns an array with the first occurrence of the specified element removed from the array.
If no match is found, the current array is returned.
Removes all the items from the array that meet the specified condition.
Returns an array with the element at the specified position removed.
Returns an array with the elements at the specified position removed.
Removes the specified items from this array.
Removes the specified items from this array.
Removes the specified values from this list.
public ImmutableArray<T> RemoveRange(ImmutableArray<T> items, IEqualityComparer<T> equalityComparer)
Removes the specified items from this list.
public ImmutableArray<T> RemoveRange(ReadOnlySpan<T> items, IEqualityComparer<T> equalityComparer = null)
Removes the specified values from this list.
Removes the specified values from this list.
Finds the first element in the array equal to the specified value and replaces the value with the specified new value.
Finds the first element in the array equal to the specified value and replaces the value with the specified new value.
Replaces the item at the specified index with the specified item.
Forms a slice out of the current ImmutableArray<T> starting at a specified index for a specified length.
Sorts the elements in the immutable array using the default comparer.
Sorts the elements in the entire ImmutableArray<T> using the specified Comparison<T>.
Sorts the elements in the immutable array using the specified comparer.
Sorts the specified elements in the immutable array using the specified comparer.
Creates a mutable array that has the same contents as this array and can be efficiently mutated across multiple operations using standard mutable interfaces.