您的位置:首页 > 产品设计 > UI/UE

KeyValuePair<TKey, TValue>泛型用法

2012-03-20 14:05 393 查看
定义可设置或检索的键/值对。

命名空间:System.Collections.Generic

程序集:mscorlib(在 mscorlib.dll 中)

Dictionary.Enumerator.Current 属性返回此类型的实例。

//Dictionary<string, int> dicNum = new Dictionary<>(string, int);

foreach(KeyValuePair<string, int> kvp in dicNum)

{

Console.Write(string.Format("{0} = {1};", kvp.Key, kvp.Value));

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: