Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

LINQ: Utilisation de ‘Any’ avec ‘EndWith’

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);
    }
}

No comments yet.

Leave a Comment