Dictionary enumeration in C#

前端 未结 4 1263
情歌与酒
情歌与酒 2020-12-29 04:16

How do I enumerate a dictionary?

Suppose I use foreach() for dictionay enumeration. I can\'t update a key/value pair inside foreach(). So I

4条回答
  •  一向
    一向 (楼主)
    2020-12-29 04:30

    Foreach. There are three ways: You can enumerate over the Keys property, over the Values property or over the dictionary itself which is an enumerator of KeyValuePair.

提交回复
热议问题