robintw robintw - 2 months ago 16
C# Question

Pop off array in C#

I've got a string array in C# and I want to pop the top element off the array (ie. remove the first element, and move all the others up one). Is there a simple way to do this in C#? I can't find an Array.Pop method.

Would I need to use something like an ArrayList? The order of the items in my array is important.

Answer

Use a List, Queue or Stack instead..

List<String>
Queue<String>
Stack<String>
Comments