title: how to find Next key using foreach in SortedDictionary in C#
body: <p>I have a sorted dictionary which has stored strings as keys and values.
  And I am checking the value of each key with some conditions.</p>
  
  <pre><code>void sample()
  {
    SortedDictionary&lt;string, string&gt;.KeyCollection keyColl = clrDatesSelectedSortedDict.Keys;
    foreach (string key in keyColl)
     {
       if(chckstring = key)
        value = clrDatesSelectedSortedDict[key];
     }
   }
  </code></pre>
  
  <p>actually in if condition i want to know the next key as well. How to get the next key value?</p>
  
  <p>And one more question, is it possible to use for loop instead of foreach for sortedDictionary in C#? </p>
  
  <p>Please help me any one of the above.
  Thanks in Advance.</p>