title: How do I select items from an array using an array of indices with Linq?
body: <p>How do I select items from an array using an array of indices with Linq?</p>
  
  <p>Following code works:</p>
  
  <pre><code>String[] A = new String[] { "one", "two", "three", "four" };
  int[] idxs = new int[] { 1, 3 };
  String[] B = new String[idxs.Length];
  for (int i = 0; i &lt; idxs.Length; i++)
  {
       B[i] = A[idxs[i]];
  }
  System.Diagnostics.Debug.WriteLine(String.Join(", ", B));
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>        two, four
  </code></pre>
  
  <p>Is there a LINQ way (or other one-liner) to get rid of the for loop?</p>