<PackageReference Include="System.Collections.Immutable" Version="11.0.0-preview.3.26207.106" />

System.Collections.Immutable.ImmutableStack

public static class ImmutableStack
Provides a set of initialization methods for instances of the ImmutableStack<T> class. NuGet package: System.Collections.Immutable (about immutable collections and how to install)
public static ImmutableStack<T> Create<T>()

Creates an empty immutable stack.

public static ImmutableStack<T> Create<T>(T item)

Creates a new immutable stack that contains the specified item.

public static ImmutableStack<T> Create<T>(T[] items)

Creates a new immutable stack that contains the specified array of items.

public static ImmutableStack<T> Create<T>(ReadOnlySpan<T> items)

Creates a new immutable stack that contains the specified array of items.

public static ImmutableStack<T> CreateRange<T>(IEnumerable<T> items)

Creates a new immutable stack that contains the specified items.

public static IImmutableStack<T> Pop<T>(this IImmutableStack<T> stack, out T value)

Removes the specified item from an immutable stack.