字典Dictionary和泛型集合List的增,删,改,查
Dictionary<string, int> dic1 = new Dictionary<string, int>();
dic1.Add("艺龙一楼", 1);
dic1.Add("艺龙二楼", 2);
dic1.Add("艺龙三楼", 3);
//查找
if (dic1.ContainsKey("艺龙二楼"))
{
int i = dic1["艺龙二楼"];
Response.Write(i);
}
dic1.Remove("艺龙二楼");
Dictionary<string, int> dic2 = dic1.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
List<string> str = new List<string>();
str.FindAll(delegate(string st) { return st == "1"; });
str.RemoveAll(delegate(string sr) { return sr == "1"; });
str.Sort(delegate(string st1, string st2) { return st1.CompareTo(st2); });