fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. int[] numbers = {1, 2, 3};
  9. string[] words = {"Uno", "Dos", "Tres"};
  10.  
  11. var numbersAndWords = numbers.Zip(words, (first, second) => String.Format("{0} {1}", first, second));
  12.  
  13. foreach (var item in numbersAndWords)
  14. {
  15. Console.WriteLine(item);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.04s 24096KB
stdin
Standard input is empty
stdout
1 Uno
2 Dos
3 Tres