How to sort a dictionary by key

Input.OrderBy does not sort the dictionary, it creates a query that returns the items in a specific order.

Perhaps OrderedDictionary gives you what you want.

Or use the Generic SortedDictionary

Leave a Comment