SyntaxFix
Write A Post
Hire A Developer
Questions
You could try using Linq to project the list:
var output = lst.Select(x => x % 2 == 0).ToList();
This will return a new list of bools such that {1, 2, 3, 4, 5} will map to {false, true, false, true, false}.
{1, 2, 3, 4, 5}
{false, true, false, true, false}