Use Quantifiers : Any : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » Any »

 

Use Quantifiers








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

public class MainClass {
    public static void Main() {
        string[] words = { "bei", "rie", "rei", "field" };

        bool iAfterE = words.Any(w => w.Contains("ei"));

        Console.WriteLine("There is a word that contains in the list that contains 'ei': {0}", iAfterE);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» Any