Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

LINQ: Utilisation de ‘Any’ avec ‘Contains’

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace LINQ
{
public class ExempleAnyContains
{
    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(m=> m.Contains(".fr"));
 
        Console.WriteLine("Verifier si un élément de la liste contient(.fr) : {0}", resultat);
    }
}
 
 }

No comments yet.

Leave a Comment