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 ")
}
标签:Console,包含,Dictionary,C#,paramsMap,Contains,Key,Stephen 来源: https://blog.51cto.com/StephenJava/2936255