简体   繁体   English

确定项目在清单上任何特定位置的价值

[英]Determining the value of an item at any specific location on a list

I have a list with multiple values ranging from 1 to 52. 我有一个列表,包含从1到52的多个值。

List<int> allCards = new List<int>(52);

I want to determine the magnitude of the value at this specific point of the list 我想确定列表中此特定点的值的大小

allCards.RemoveAt(this._totalCardNumber);

How would I do that? 我该怎么做?

Do you want to get the value of an element in the list? 是否要获取列表中某个元素的值?

If that is the case, just use the indexer property of the list (assuming it's a List<int> or something like that. 如果是这种情况,只需使用列表的indexer属性(假设它是List<int>或类似的东西)。

eg 例如

var value = list[_totalCardNumber];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM