Where clause with string method and return IEnumerable object : where : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » where »

 

Where clause with string method and return IEnumerable object








    
 

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {


        string[] presidents = {"AA", "A", "AAA", "B", "Ca", "C"};

        IEnumerable<string> items = presidents.Where(p => p.StartsWith("A"));

        foreach (string item in items)
            Console.WriteLine(item);

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» where