更新时间:2023-01-24 10:26:34
您可以执行removeat来删除位于特定索引处的项目,并且可以检查计数查看列表包含多少项.
You can do removeat in order to remove whichever item is at a particular index and you can check the count to see how many items a List contains.
这意味着您可以执行以下操作:
Meaning you can do something like:
MyList.Add(item);
if (MyList.Count > 1000)
MyList.RemoveAt(0);