All with condition : All : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » All »

 

All with condition








    
 

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;

public class MainClass{
   public static void Main(){
       int[] numbers = { 2, 6, 1, 56, 102 };
       Console.Write(numbers.All(e => e % 2 == 0) ? "Yes, they are" : "No, they aren't");
   }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» All