小编Yoy*_*oyo的帖子

Linq: Filter a list with a different IEnumerable<bool>

I cannot find out how to filter an array/list from another list array: I was looking for something like this:

IEnumerable<bool> Filter = new[] { true, true, false,true };

IEnumerable<string> Names = new[] { "a", "B", "c", "d" };

List<string> NameFiltered = Filter
    .Where(c => c == true)
    .Select(x => Names)
    .ToList();
Run Code Online (Sandbox Code Playgroud)

c# linq ienumerable boolean

2
推荐指数
1
解决办法
3742
查看次数

标签 统计

boolean ×1

c# ×1

ienumerable ×1

linq ×1