C# Dictionary 类型判断是否包含某个 Key

Dictionary<string, object> paramsMap = new Dictionary<string, object>();

paramsMap["1"] = "值"; 
paramsMap["2"] = "Stephen 公众号"; 
paramsMap["3"] = "StephenJava 微信号"; 
//Contains来判断
if (routeParams.Contains("1")){
   Console.WriteLine("paramsMap 包含key:1 ")
}

 

上一篇:JavaWeb19.5【Filter&Listener:案例1-登录验证】


下一篇:The class file Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT> contains a signature 报错eclipse