How to insert element in first index in dictionary?

前端 未结 9 1032
被撕碎了的回忆
被撕碎了的回忆 2020-12-17 10:09

Is there a method or technique that allows you to insert an element into a Dictionary guaranteeing that the item is in the first index of t

9条回答
  •  温柔的废话
    2020-12-17 10:36

    The Dictionary class does not hold items in an ordered manner, so there is no "first" item.

    There is a SortedDictionary (.NET 4.0+), which sorts by the key, but again, this is a very vague idea of "first".

提交回复
热议问题