Lambda表达式学习
代码:
static void Main(string[] args)
{
List<int> IntList = new List<int> { 1, 2, 3, 4, 5, 6 };
var ConLint = IntList.FindAll(i => (i % 2) == 0);
foreach (var OneLint in ConLint)
{
Console.WriteLine(OneLint);
}
}
效果:
2
4
6