Linq Example 31 - All

11:54 PM
Linq Query:

//all
            int[] intNumbers = { 1, 2, 3, 55, 99, 74, 102 };

            bool blnLessThan200 = intNumbers.All(n => n <= 200);

            Console.WriteLine(blnLessThan200);

//

Output:
True
It will simply check if all the elements in array are less than 200.

0 comments:

Post a Comment