Dictionary.TryGetValue 方法
来源:互联网 发布:淘宝有3ds正版么 编辑:程序博客网 时间:2024/06/06 18:58
public bool TryGetValue (TKey key,out TValue value)参数
- key
要获取的值的键。
- value
当此方法返回值时,如果找到该键,便会返回与指定的键相关联的值;否则,则会返回 value 参数的类型默认值。该参数未经初始化即被传递。
返回值
如果 Dictionary 包含具有指定键的元素,则为 true;否则为 false。string value = ""; if (openWith.TryGetValue("tif", out value)) { Console.WriteLine("For key = /"tif/", value = {0}.", value); } else { Console.WriteLine("Key = /"tif/" is not found."); }... // The indexer throws an exception if the requested key is // not in the dictionary. try { Console.WriteLine("For key = /"tif/", value = {0}.", openWith["tif"]); } catch (KeyNotFoundException) { Console.WriteLine("Key = /"tif/" is not found."); }
- Dictionary.TryGetValue 方法
- Dictionary的TryGetValue方法
- 关于Dictionary的TryGetValue方法
- 关于Dictionary的TryGetValue方法
- 关于Dictionary的TryGetValue方法
- Dictionary之TryGetValue
- c# Dictionary的TryGetValue的用法
- Dictionary的遍历方法
- Python 字典(Dictionary) setdefault()方法
- Python 字典(Dictionary) has_key()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) items()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) setdefault()方法
- Dictionary
- dictionary
- 关于在list中按中文排序问题
- VS08中的代码自动提示快捷键设置
- delphi open arrays和dynamic arrays区别
- Windows下的Memcache安装
- (转)Linux静态/动态链接库的创建和使用 (为完全解决我的问题,但有借鉴作用)
- Dictionary.TryGetValue 方法
- 试用MySQL5.5GA
- c++并发编程,简单模拟飞机订票系统
- WordPress初级教程-22: Wordpress 安全建议与技巧
- 什么是动、静态语言 和 什么是强、弱类型语言
- 交换机通过port-channel互联
- 对web.config进行新增修改删除读取操作
- android真机调试方法
- WordPress初级教程-23: 更换Wordpress主题后的注意事项