Is it possible to sort a HashTable?

前端 未结 11 722
不知归路
不知归路 2021-01-17 10:13

I have a property that returns a HashTable. I would like to sort it without refactoring my property. Please note: I do not want to return another type.

11条回答
  •  抹茶落季
    2021-01-17 10:56

    Hashtables work by mapping keys to values. Implicit in this mapping is the concept that the keys aren't sorted or stored in any particular order.

    However, you could take a look at SortedDictionary.

提交回复
热议问题