LINQ: Utilisation de ‘Any’ avec ‘EndWith’

Author:

LINQ, All, Any, Concat, Contains, Agrégat, Union, Select, Order, From, Where
{filelink=15073}

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

public class ExempleAnyEndWith
 {
    public static void Main()
	{
         string[] listeSite = {"java.mesexemples.com", "php.mesexemples.com", "android.mesexemples.com", "www.yahoo.com", "www.google.fr" };
         bool resultat = listeSite.Any(s => s.EndWith(".net"));
         Console.WriteLine("Verifier si un élément de la liste se termine par(.net) : {0}", resultat);
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *