我有可憎的
Hashtable hash = new Hashtable();
hash.Add("a", "1");
hash.Add("b","2");
hash.Add("c","3");
hash.Add("c","4"
Run Code Online (Sandbox Code Playgroud)
现在我需要检查Key ="c"和value ="3"组合是否已经在哈希表中退出.
hash.ContainsKey
值函数cheks天气键是否存在和ContainsValue
功能检查天气值是否存在.但如果我试过
if( hash.Contains("c") && hash.ContainsValue("3"))
{
// some code heree
}
Run Code Online (Sandbox Code Playgroud)
对于"c,3"和"c,4"组合,它将返回真实.
我需要检查键/值对组合,我该如何检查?
归档时间: |
|
查看次数: |
14531 次 |
最近记录: |