关闭弹出在C#中的数组 [英] Pop off array in C#

查看:127
本文介绍了关闭弹出在C#中的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在C#中的字符串数组,我想弹出关闭阵列顶部元素(即删除第一个元素,并且将所有其他人了一个)。有一个简单的方法在C#这样做吗?我无法找到一个方法Array.Pop

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.

请问我需要使用像一个ArrayList?在我的阵列中的项目的顺序是很重要的。

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

推荐答案

使用一个列表队列或的堆栈代替。

Use a List, Queue or Stack instead..

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

这篇关于关闭弹出在C#中的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆