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));
}
命名空间: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));
}
相关文章推荐
- C# KeyValuePair<TKey,TValue>的用法【转】
- KeyValuePair<TKey, TValue>是DictionaryEntry的泛型版本
- C# Dictionary的用法 KeyValuePair<TKey, TValue> 结构
- 获取KeyValuePair<string, object>)泛型结构的默认值
- C# KeyValuePair<TKey,TValue>的用法-转载
- List<KeyValuePair<int, DateTime> 用法
- C#基础第四天-作业-Hashtable-list<KeyValuePair>泛型实现名片
- C#基础第四天-作业答案-Hashtable-list<KeyValuePair>泛型实现名片
- C# KeyValuePair<TKey,TValue>的用法
- KeyValuePair<byte, string> 类型的数据如何绑定到ComboBox控件上
- Dictionary、List<KeyValuePair<i>>的组合使用
- C# KeyValuePair<TKey,TValue>的用法【转】
- Android Post参数提交 List<NameValuePair>,web端获取数据
- NSUnknownKeyException', reason: '[<UIApplication 0x8a58320> setValue:forUndefinedKey:]
- C# KeyValuePair 的基本用法及结合泛型的用法
- Dictionary<TKey, TValue> 的foreach便利方法
- 将正则表达式处理的内容转换到Dictionary<key, value>中
- reason: '[<__NSDictionary0 0x7fda88f00c90> setValue:forUndefinedKey:]: this class is not key value c
- android关于HashMap<String, Integer>取最大的value,并找出key。
- Hadoop Writable深度复制及读取任意<key,value>序列文件