我是新的字典,所以我有這個基本的問題。檢查一個特定的密鑰在一個字典中的值是什麼
我有這樣一本字典:
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