fork(2) download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. String[] A = new String[] { "one", "two", "three", "four" };
  9. int[] idxs = new int[] { 1, 3 };
  10. var result = idxs.Select(i => A[i]).ToArray();
  11.  
  12. foreach(var s in result)
  13. Console.WriteLine(s);
  14. }
  15. }
Success #stdin #stdout 0.03s 33840KB
stdin
Standard input is empty
stdout
two
four