📜  收藏已修改;枚举操作可能不会执行. c# 数据表代码示例

📅  最后修改于: 2022-03-11 14:49:23.206000             🧑  作者: Mango

代码示例1
using CentroidsList = System.Collection.Generic.List<...>; //put the type of the element of newSpectrum.PeakCentroids

//...

CentroidsList list = new CentroidsList();
foreach (var element in newSpectrum.PeakCentroids)
   if (SomeCondition(element))
       list.Add(element);
foreach (var element in list)
   newSpectrum.PeakCentroids.Remove(element);