SortedDictionary<TKey, TValue>.GetEnumerator Method is used to get an enumerator that iterates through the SortedDictionary<TKey, TValue>.
Syntax:
public System.Collections.Generic.SortedDictionary<TKey, TValue>.Enumerator GetEnumerator ();
Return Value: This method returns an
SortedDictionary<TKey, TValue>.Enumerator for the SortedDictionary<TKey, TValue>.
Below programs illustrate the above-discussed method:
Below programs illustrate thabove-discusseddiscussed method:
Example 1:
Output:
Australia --> Canberra
Belgium --> Brussels
China --> Beijing
India --> New Delhi
Netherlands --> Amsterdam
Russia --> Moscow
Example 2: