可能重复: What's IEnumerable和阵列,IList的和列表之间的区别是什么?
什么是以上两者之间的区别是什么?
What's the difference between the above two?
A 名单,其中,串>
是一个具体的实施的IEnumerable&LT的;串>
。不同的是,的IEnumerable<字符串>
是字符串
但名单,其中仅仅一个序列;字符串>
是可转位由 INT
的索引,可以添加和删除,并有特定的索引处插入项
A List<string>
is a concrete implementation of IEnumerable<string>
. The difference is that IEnumerable<string>
is merely a sequence of string
but a List<string>
is indexable by an int
index, can be added to and removed from and have items inserted at a particular index.
基本上,接口的IEnumerable&LT;字符串&GT;
让你流的字符串
序列中,但列表与LT;字符串&GT;
可以让你做到这一点,以及修改和访问的具体方式列表中的项目。一个的IEnumerable&LT;字符串&GT;
是字符串
可重复,但不允许随机访问的一般顺序。 A 名单,其中,串&GT;
是一个特定的随机存取大小可变的集合
Basically, the interface IEnumerable<string>
lets you stream the string
in the sequence but List<string>
lets you do this as well as modify and access the items in the lists in specific ways. An IEnumerable<string>
is general sequence of string
that can be iterated but doesn't allow random access. A List<string>
is a specific random-access variable-size collection.
上一篇:如何将来自不同EXCEL工作表的数据绘制在同一图表中图表、如何将、不同、数据
下一篇:安装/卸载服务在Windows 7:&QUOT;错误1001指定的服务已被标记为删除&QUOT;已被、标记、错误、Windows