Answers for "how to print combine arrays in 1 array c#"

C#
6

c# merging two arrays

T[] array1 = getOneArray();
T[] array2 = getAnotherArray();
T[] newArray = new T[array1.Length + array2.Length];
Array.Copy(array1, newArray, array1.Length);
Array.Copy(array2, 0, newArray, array1.Length, array2.Length);
Posted by: Guest on July-11-2020
1

how to concatenate two arrays in c#

var z = new int[x.Length + y.Length];
x.CopyTo(z, 0);
y.CopyTo(z, x.Length);
Posted by: Guest on July-09-2020

C# Answers by Framework

Browse Popular Code Answers by Language