我有一个列表:
List<int> MyList = new List<int>();
我在其中添加了10个整数值:
for{i=1;i<10;i++}
MyList.Add(1);
我可以一次性将其清空吗,而不是使用
Remove
函数的10次迭代- 带有
Predicate<(Of <(T>)>)
泛型委托的RemoveAll
方法。
我有一个列表:
List<int> MyList = new List<int>();
我在其中添加了10个整数值:
for{i=1;i<10;i++}
MyList.Add(1);
我可以一次性将其清空吗,而不是使用
Remove
函数的10次迭代Predicate<(Of <(T>)>)
泛型委托的RemoveAll
方法。