title: using a for loop to iterate through a dictionary
body: <p>I generally use a foreach loop to iterate through Dictionary.</p>
  
  <pre><code>Dictionary&lt;string, string&gt; dictSummary = new Dictionary&lt;string, string&gt;();
  </code></pre>
  
  <p>In this case I want to trim the entries of white space and the foreach loop does however not allow for this.</p>
  
  <pre><code>foreach (var kvp in dictSummary)
  {
      kvp.Value = kvp.Value.Trim();    
  }
  </code></pre>
  
  <p>How can I do this with a for loop?</p>
  
  <pre><code>for (int i = dictSummary.Count - 1; i &gt;= 0; i--)
  {
  }
  </code></pre>