13. 量词操作符—【LINQ标准查询操作符】

public class All_LINQ
    {
        public static void All_Print()
        {
            int[] num = { 1, 2, 34, 54, 45, 63, 90 };
            Console.WriteLine(num.All(c => c % 2 == 0));
            Console.WriteLine(num.All(c => c>= 0));
        }

        public static void Any_Print()
        {
            int[] num = { 1, 2, 34, 54, 45, 63, 90 };
            Console.WriteLine(num.Any(c => c % 2 == 0));
            Console.WriteLine(num.Any(c => c < 0));
        }

        public static void Contains_Print()
        {
            int[] num = { 1, 2, 34, 54, 45, 63, 90 };
            Console.WriteLine(num.Contains(20));            
        }
    }
posted @ 2010-04-17 22:08  CityWalker  阅读(235)  评论(0编辑  收藏  举报
天天来