如何根据条件获取List中项的index集合

  有时可能需要需要获取一个List中符合某条件的项的index集合,可以使用如下Linq语句:

var query = source.Select((value, index) => new { value, index }).Where(x => x.value => Condition(value)).Select(x => x.index);
原文地址:https://www.cnblogs.com/qishichang/p/2230759.html