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