我定义了一个列表如下:
List<List<int>> thirdLevelIntersection = new List<List<int>>();
我写的代码是
for(int i = 0; i < 57; i++)
{
if(my condition)
thirdLevelIntersection[i] = null;
else
{
//some logic
}
}
我得到了0到56个值的列表,一些任意值是null,如thirdlevelIntersection [1]、thirdlevelIntersection [10]、thirdlevelIntersection [21]、thirdlevelIntersection [21]、thirdlevelIntersection [14]、thirdlevelIntersection [15]、thirdlevelIntersection [51](总共7个)。
现在我想从列表中删除这些值。
并且获得从thirdlevelIntersection [0]到thirdlevelIntersection [49]的列表。
我该怎么做?