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

posted @ 2011-11-05 09:18  踏浪帅  阅读(122)  评论(0编辑  收藏  举报