大家好,又见面了,我是你们的朋友全栈君。
List<KeyValuePair<string,string>> list = new List<KeyValuePair<string, string>>();
list.Add(new KeyValuePair<string, string>(“asdf1”, “1”));
list.Add(new KeyValuePair<string, string>(“asdf1”, “1”));
list.Add(new KeyValuePair<string, string>(“asdf1”, “1”));
Dictionary<string, string> dictionary = list.ToDictionary(x => x.Key, x => x.Value);
list = dictionary.ToList();
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/158830.html原文链接:https://javaforall.cn