int [] numbers = new int[5]; // 长度为5,元素类型为 int。 不同的格式:
names.GetLength(0); // 获得二维数组的横向长度 names.GetLength(1); // 获得二维数组的纵向长度。 |
|
System.Collections.ArrayList ArrayList al = new ArrayList(); al.Add(5); al.Add("Hello Tom"); |
System.Collections.Generic.List<T> List<int> intList = new List<int>(); intList.Add(500); intList.AddRange(new int[]{1,100}; intList.Insert(1, 1000); cw(intList.Contains(100)); cw(intList.indexOf(10)); |
System.Collections.HashTable HashTable ht = new HashTable(); ht.Add("name", "Tom"); ht.Add("age", 18); |
System.Collections.Generic.Dictionary<TKey, TValue> Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("name", "Tom"); dic.Add("age", "eighteen"); |
相关文章
- C#中数组、List和Array List三者的区别
- C#集合类型——Array、ArrayList、List 之浅谈
- C#常用的集合类型(ArrayList类、Stack类、Queue类、Hashtable类、SortedList类)
- 【转载】C#中List集合使用LastOrDefault方法查找出最后一个符合条件的元素
- 【转载】C#中List集合使用Exists方法判断是否存在符合条件的元素对象
- 集合的概念 Stack和Queue Dictionary ArrayList和List
方法及用法 - C#集合List与HashSet的区别,以及判断集合中是否存在重复的元素
- [转帖]C#中字典集合HashTable、Dictionary、ConcurrentDictionary三者区别
- 通俗易懂,C#如何安全、高效地玩转任何种类的内存之Span的脾气秉性(二)。 异步委托 微信小程序支付证书及SSL证书使用 SqlServer无备份下误删数据恢复 把list集合的内容写入到Xml中,通过XmlDocument方式写入Xml文件中 通过XDocument方式把List写入Xml文件
- .NET[C#]使用LINQ从List
集合中获取最后N条数据记录的方法有哪些?