title: Dictionary<int,string> Remove last item
body: <p>Ok I'm being dense.</p>
  
  <p>How do I remove the last item in a dictionary?</p>
  
  <p>I have code that checks for the number in the dictionary and ifs too many it always removes the last one to make room the for the next but I can't see a straightforward way to do it</p>
  
  <pre><code>if (recentDic.Count&gt;= recentItemLimit )
    recentDic.RemoveAt(recentDic.Count-1)
  
  recentDic.Add(i,someString);
  </code></pre>
  
  <p><strong>UPDATE:</strong> Thanks for the comments, you learn something everyday. I have moved over to a OrderedDictionay and am now using RemoveAt</p>