Jar*_*Par 13
如果您想知道列表中有多少元素,请使用Count属性.
int numElements = list.Count;
Run Code Online (Sandbox Code Playgroud)
另一方面,如果您想知道List<T>当前可以处理的后备存储的元素数量,那么请使用Capacity属性.
int size = list.Capacity;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10511 次 |
| 最近记录: |