在读取列表'lst‘时,我想删除不满足某些条件的删除元素。基于以下答案:Strange result when removing item from a list while iterating over it,我找到了一个非常有效的解决方案。以下是PyCharm中的代码: for ind, el in enumerate(lst):
if not el.strip() or el
在大多数情况下,我使用的是All(并返回true)而不是ForEach。使用ALL而不是ForEach是否是一种好的实践(如果是IEnumerable),我知道所有这些都可以在IEnumerable上运行,而foreach只在列表上运行
var wells = GlobalDataModel.WellList.Where