Tech Off Post

Single Post Permalink

View Thread: How do you output the contents of a Dictionary class?
  • User profile image

    There's a SortedDictionary that is implemented using a tree so that the dictionary is sorted by the key. There's tradeoffs between using trees and hashtables, so be sure which data structure you really want before blindly switching. With a SortedDictionary you'd just use foreach to iterate over the KeyValuePair items in the dictionary, or use the Keys or Values properties to iterate over just the key or just the value.