Push All to Stack - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:Stack

Description

Push All to Stack

Demo Code

// Licensed under the Apache License, Version 2.0 (the "License");
using System.Linq;
using System.Collections.Generic;
using System;/*from   w ww.  ja v  a2 s . c  o  m*/

public class Main{

        public static void PushAll<T>(this Stack<T> collection, IEnumerable<T> enumer)
        {
            foreach (T obj in enumer)
            {
                collection.Push(obj);
            }
        }
}

Related Tutorials