loc*_*boy 6 c# asp.net list
如何在c#中访问List <>的大小?在数组中,它是array.length,但List <>的属性是什么?
dri*_*iis 13
它是List 的Count属性,几乎是Framework中的任何其他集合类.Count属性也在ICollection <T>接口上定义.
Jar*_*Par 13
如果您想知道列表中有多少元素,请使用Count属性.
int numElements = list.Count;
另一方面,如果您想知道List<T>当前可以处理的后备存储的元素数量,那么请使用Capacity属性.
List<T>
int size = list.Capacity;
Dav*_*sky 5
Count 属性将为您提供列表中对象的数量。
归档时间:
15 年,6 月 前
查看次数:
10511 次
最近记录: