title: Joining/merging arrays in C#
body: <p>I have two or more arrays -- one with IDs, one or more with string values. I want to merge these into a hash table so I can look up values by ID.</p>
  
  <p>The following function does the job, but a shorter and sweeter version (LINQ?) would be nice:</p>
  
  <pre><code>Dictionary&lt;int, string[]&gt; MergeArrays( IEnumerable&lt;int&gt; idCollection,
                                         params IEnumerable&lt;string&gt;[] valueCollections )
  {
      var dict = new Dictionary&lt;int, string[]&gt;();
  
      var idL = idCollection.Count();
      while ( idL-- &gt; 0 )
      {
          dict[idCollection.ElementAt( idL )] = new string[valueCollections.Length];
  
          var vL = valueCollections.Length;
          while ( vL-- &gt; 0 )
              dict[idCollection.ElementAt( idL )][vL] = valueCollections[vL].ElementAt( idL );
      }
  
      return dict;
  }
  </code></pre>
  
  <p>Any ideas?</p>