我是新的字典,所以我有这个基本的问题。检查一个特定的密钥在一个字典中的值是什么
我有这样一本字典:
Dictionary<string, string> usersLastStamp = checking.checkLastStamp();
我怎样才能做一个if语句来检查,如果一个特定键的值是什么?
像这样:
if(usersLastStamp.the_value_of_key("theKey") == "someValue")
{
//Do something
}
我已经采取一看TryGetValue,但我不是很清楚如何直接在if语句使用它像上面。
你可以谷歌它...如何从字典 – mybirthname 2014-10-07 10:31:20