LINQ: Utilisation de ‘Concat’ sur un tableau de ‘string’

Author:

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

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

namespace LINQ
{
    public class ExempleConcatString
    {
        public static void Main()
        {
            string[] listeSite = {
              "java.mesexemples.com",
              "php.mesexemples.com",
              "android.mesexemples.com",
              "www.yahoo.com",
              "www.google.fr" };

            IEnumerable nouvelleListe = listeSite.Take(5).Concat(listeSite.Skip(5));

            foreach (string elem in nouvelleListe)
            {
                Console.WriteLine(elem);
            }
        }
    }

}

Leave a Reply

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