[Solved] c# replace odd elements of array with even elements of another array
[ad_1] Even though this is a very specific problem, here’s a solution: var array1 = new[] { 2, 5, 7, 8, 9, 4 }; var array2 = new [] { 4, 8, 2, 1, 5, 8 }; array1 = array1.Select((i, index) => i % 2 == 1 ? array2[index] : i).ToArray(); //result: int[6] { 2, … Read more