Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

LINQ: Utilisation de ‘Concat’ avec ‘Skip’, et ‘Take’

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

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
 
namespace LINQ
{
public class ExempleConcatTakeSkip
{
    public static void Main()
	{
        string[] listeSite = {
              "java.mesexemples.com",
              "php.mesexemples.com",
              "android.mesexemples.com",
              "www.yahoo.com",
              "www.google.fr" };
        IEnumerable<string> nouvelleListe = new[] {
                                   listeSite.Take(2),
                                   listeSite.Skip(2)
                                  }.SelectMany(s => s);
        foreach (string elem in nouvelleListe)
            Console.WriteLine(elem);
    }
}
 
 }

No comments yet.

Leave a Comment