int[] array1 = { 1, 2, 3, 4, 5 }; int[] array2 = { 6, 7, 8, 9, 10 }; var list = new List<int>(); for (int i = 0; i < array1.Length; i++) { list.Add(array1[i]); list.Add(array2[i]); } int[] array3 = list.ToArray();
string[] array1 = new string[] { "1", "2", "3"}; string[] array2 = new string[] { "6", "7", "8"}; string[] MergedArray = array1.Zip(array2, (a,b)=> new[]{a,b}).SelectMany(x=>x).ToArray();
int [] SouceArray1 = new int[] {2,1,3}; int [] SourceArray2 = new int[] {4,5,6}; int [] targetArray = new int [SouceArray1.Length + SourceArray2.Length]; SouceArray1.CopyTo(targetArray,0); SourceArray2.CopyTo(targetArray,SouceArray1.Length) ; foreach (int i in targetArray) Console.WriteLine(i + " ");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)