title: How to convert an array to a dictionary using LINQ
body: <p>I have a string array that I want to convert to a <code>Dictionary</code> using <em>Linq</em>.
  I want elements with a <strong><em>even index</em></strong> (including zero) to be <strong>keys</strong> and elements with an <strong><em>odd index</em></strong> to be <strong>values</strong> in the dictionary. I created a dictionary using a <code>for loop</code>:</p>
  
  <pre><code>string[] arr = new string[4];
  arr[0] = "John";
  arr[1] = "A";
  arr[2] = "Luke";
  arr[3] = "B";
  
  Dictionary&lt;string, string&gt; myDict = new Dictionary&lt;string, string&gt;();
  
  for (int i = 0; i &lt; arr.Length - 1; i += 2)
  {
      myDict.Add(arr[i], arr[i + 1]);
  }
  
  //myDict -&gt; { { "John", "A" },{"Luke","B"} }
  </code></pre>
  
  <p>And now I am curious how to do it with <em>LINQ</em> <code>ToDictionary()</code>:</p>
  
  <pre><code>myDict = arr.ToDictionary();
  </code></pre>