码迷,mamicode.com
首页 > 其他好文 > 详细

20141021--集合

时间:2014-10-21 17:25:44      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   ar   sp   数据   div   

集合是一个类,在System.Collections库中,需要先引用。集合的理论空间是无限的。一般不需额外定义。

using System.Collections;

集合也是有索引的 从0开始。

bubuko.com,布布扣

1.  

Insert 在集合中  插入一个数据

bubuko.com,布布扣

2.   

Remove  移除第一个符合的数据。

bubuko.com,布布扣

3.

Count   集合中元素的个数

bubuko.com,布布扣

4.

冒泡排序 Sort() 从小到大排序

bubuko.com,布布扣

bubuko.com,布布扣

5.

Reverse()  将数组中的元素翻转

bubuko.com,布布扣

6.

IndexOf  搜索第一个匹配的数据

LastIndexOf  搜索最后一个匹配的数据

bubuko.com,布布扣

7.

清空。Clear

            jh.Clear();//清空集合中的数据

jh.Clear();//清空集合中的数据

 8.

复制 Clone

1             ArrayList jh1 = new ArrayList();
2             jh1 = (ArrayList)jh.Clone();//复制集合中的元素,写入到另一个集合中

 

20141021--集合

标签:style   blog   http   color   io   ar   sp   数据   div   

原文地址:http://www.cnblogs.com/Tirisfal/p/4040708.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!