CSharp - Select string by ending with

Description

Select string by ending with

Demo

using System;  
using System.Linq;  
class Program//from  ww  w  .j  av a  2  s  .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