Linq Example 33 - Count Conditional

1:36 AM
Linq Query:

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

            int total = intNumbers.Count(n => n < 10 ); //Total 3 Items which are less then 10

            Console.WriteLine(total);

//

Output:
 3 

 Total 3 Items which are less then 10

0 comments:

Post a Comment