Concat two Array - CSharp System

CSharp examples for System:Array Element Add

Description

Concat two Array

Demo Code


using System.Linq;
using System.Collections.Generic;
using System;/*from w  w w .  j av a  2  s.  com*/

public class Main{
        public static T[] Concat<T>(this T[] array1, T[] array2)
        {
            var result = new T[array1.Length + array2.Length];

            array1.CopyTo(result, 0);
            array2.CopyTo(result, array1.Length);

            return result;
        }
}

Related Tutorials