public static string get_val_by_key(this Dictionary<string, string> dictionary, string key) => dictionary == null || !dictionary.ContainsKey(key) ? "" : dictionary[key];
该封装自动判断dic对象是否为null,和包含特定的key,默认放回为空;否则返回对应的值。
标签:dictionary,Dictionary,C#,获取,key,null,string From: https://www.cnblogs.com/IBPM/p/17158831.html