Use string method in where clause : where : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » where »

 

Use string method in where clause








    
 


using System;
using System.Linq;

public class MainClass {
    public static void Main() {
        string[] greetings = { "hello world", "hello LINQ", "hello" };

        var items =
         from s in greetings
         where s.EndsWith("LINQ")
         select s;

        foreach (var item in items)
            Console.WriteLine(item);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» where