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.
Array elements can be deleted using the JavaScript operator delete . Using delete leaves undefined holes in the array. Use pop() or shift() instead.
Deletion refers to removing an existing element from the array and re-organizing all elements of an array.
Use a List, Queue or Stack instead..
List<String> Queue<String> Stack<String>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With