勤奋菜鸟的天堂

导航

2012年9月7日 #

泛型集合(.NET 2.0)

摘要: 1、List<T> 来判断是否为空:count属性; 判断某个元素是否在该List中:List.Contains(T item); 遍历可使用:foreach、for; List清空:List.Clear();2、Dictionary<T1,T2> 来判断是否为空:count属性; 遍历可使用://KeyValuePair<T,K> foreach(KeyValuePair<string,int> kvinlist) { Console.WriteLine(kv.Key + kv.Value); } //3.0以上版本foreach(varite 阅读全文

posted @ 2012-09-07 13:29 勤奋的菜鸟 阅读(388) 评论(0) 推荐(0) 编辑