惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
The Cloudflare Blog
宝玉的分享
宝玉的分享
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - 8user

partial关键字的含义和使用 JS仿Open()打开一个新窗口,并不是弹出新窗口 判断是否含有汉字 - 8user - 博客园 如何统计代码行执行的时间? - 8user - 博客园 时间的正则表达式验证 深入探讨IsPostBack【转】 IIS无法启动的解决方法 FCKEditor的使用及配置方法 Cool MVC: 使用正则式限定路由规则Rount - 8user C#中的值类型和引用类型 C#在线备份数据库至制定目录 - 8user - 博客园 c#实现天气预报查询 C#中的枚举器 C#里面比较时间大小三种方法 - 8user - 博客园 SQL Server数据库开发的二十一条规则 c#实现程序的开机启动 - 8user - 博客园 VS2008 快捷键大全 C#调用dos命令 反射性能测试
c#中删除ArrayList中的重复数据 - 8user - 博客园
8user · 2009-06-10 · via 博客园 - 8user

ArrayList arrayList = new ArrayList();
            arrayList.Add("1");
            arrayList.Add("1");
            arrayList.Add("2");
            arrayList.Add("2");
            arrayList.Add("3");
            arrayList.Add("3");
            arrayList.Add("4");
            arrayList.Add("5");           
            arrayList.Add("4");
            arrayList.Add("5");
            //删除重复数据
            for (int i = 0; i < arrayList.Count; i++)
            {
                for (int j = i + 1; j < arrayList.Count; j++)
                {
                    if (arrayList[i].Equals(arrayList[j]))
                    {
                        arrayList.RemoveAt(j);
                        if (i > 0)
                        {
                            i--;
                        }
                    }
                }
            }

posted on 2009-06-10 14:54  8user  阅读(2960)  评论()    收藏  举报