CSharp - Select string by ending with

Description

Select string by ending with

Demo

using System;  
using System.Linq;  
class Program/*  w ww.ja  va 2s .  com*/
{
    static void Main(string[] args)
    {
            string[] greetings = {"hello world", "hello LINQ", "hello book2s.com linq"};  
              
            var items =   
              from s in greetings  
              where s.EndsWith("LINQ")  
              select s;  
              
            foreach (var item in items)  
              Console.WriteLine(item);  
              
    }
}

Result

Related Example