title: A composite format string in conjunction with DataTable.Select()
body: <p>I've got an array with three elements</p>
  
  <pre><code>string[] cat = new string[3] { "XBox360", "PS3", "Wii" };
  </code></pre>
  
  <p>then my I basically compare the array agianst a <code>DataTable</code> and do some manipulation under certain conditions. The code that (I didn't write) performs match is this:</p>
  
  <pre><code>drResults = dtResults.Select(String.Format("Cat = '{0}' AND Cat_Entries = '{1}'", category, cat[i]));
  </code></pre>
  
  <p>The category (Cat) varialble contains a category numbers and Cat_Entries the elements of the cat array. And so in the code I perform operations if the drResult.Lenght > 0.</p>
  
  <p>What I don't understand is what does the code inside Format() do? I'm looking at <a href="http://msdn.microsoft.com/en-us/library/txafckwd%28v=vs.100%29.aspx" rel="nofollow">Microsoft's definition</a> but what throws me off is the "AND". Also are the numbers between curly brackets {} like a sequential index designator that tell the runtime that the category element repalces Zero, and cat[i] replaces One?</p>
  
  <p>All this is of course inside a loop and other code but I don't think it really adds to the question so I left it out.</p>