Enqueue for IEnumerable - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:IEnumerable

Description

Enqueue for IEnumerable

Demo Code

// Copyright (c) .NET Foundation. All rights reserved.
using System.Collections.Generic;

public class Main{
        public static Queue<T> Enqueue<T>(this Queue<T> queue, IEnumerable<T> items)
        {/*from w  ww.  j  a v  a  2  s  .c  o m*/
            foreach (var item in items)
            {
                queue.Enqueue(item);
            }

            return queue;
        }
}

Related Tutorials