LINQ: Utilisation de ‘Concat’ pour enchaîner deux tableaux

Author:

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

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

namespace LINQ
{
    public class ExempleConcat2
    {
        public static void Main()
        {
            int[] nombres1 = { 0, 2, 4, 5, 6, 8, 9 };
            int[] nombres2 = { 10, 20, 30, 40, 50 };

            var combiner = nombres1.Concat(nombres2);

            Console.WriteLine("Résulatat de concaténation:");
            foreach (var n in combiner)
            {
                Console.WriteLine(n);
            }
        }
    }
}

Leave a Reply

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