在这里与一些 LinqToExcel 过滤作斗争......
我有一个List<string> columnsToFilter包含 9 个字符串的 a,我想过滤掉 a 中某些列的数据List<Row>,其中Row包含属性
IEnumerable<string> ColumnNames
Cell this[string columnName]
所以:List<Row>有 30 行,每行有 12 个列名。现在我想过滤它,List<Row>以便List<string> columnsToFilter我最终List<Row>得到 30 行和9个列名。
我可以通过查询列名来选择一列的数据:
var result = content.Select(m => m["Column1"]).ToList();
现在我想根据字符串列表List<string> columnsToFilter过滤数据。实现这一目标的最佳方法是什么?