CollectionExtensions.

PushRange<T>(Stack<T>, IEnumerable<T>) Method

Summary

Pushes the elements of the specified collection to the Stack<T>.

Syntax

public static void PushRange<T>(this Stack<T> stack, IEnumerable<T> collection)

Type Parameters

Name Description
T The type of elements in the collection.

Parameters

Name Type Description
stack Stack<T> The Stack<T> to add items to.
collection IEnumerable<T> The collection whose elements should be pushed on to the stack. It can contain elements that are , if type T is a reference type.

Return Value

Type Description
void