Pop array element - CSharp System

CSharp examples for System:Array Operation

Description

Pop array element

Demo Code


using System.Collections.Generic;

public class Main{
        public static T[] Pop<T>(T[] toPop)
        {/*from   ww  w . ja  va  2s. co  m*/
            var popped = new List<T>(toPop);
            popped.RemoveAt(0);
            return popped.ToArray();
        }
}

Related Tutorials