RosettaCodeData/Task/Loop-over-multiple-arrays-s.../C-sharp/loop-over-multiple-arrays-s...

5 lines
157 B
C#

int[] numbers = { 1, 2, 3, 4 };
string[] words = { "one", "two", "three" };
Console.WriteLine(numbers.Zip(words, (first, second) => first + " " +
second));