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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
IT之家
IT之家
Y
Y Combinator Blog
T
Tailwind CSS Blog
B
Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
J
Java Code Geeks
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog

博客园 - 零点时刻

一千万条数据数据搜索问题! 嵌套DataGrid,中如何添加删除事件?(望能暂时放一下,谢谢了!) 嵌套DataGrid,中如何添加删除事件? 计算机类资源网:http://www.3human.com/ 互动形式 用户可以上传资料 今天心情有点郁闷! 动态加载用户控件的组件!(二) (转) 动态加载用户控件的组件!(四) Asp.Net Forums研究文章集合(收藏) 【MasterPages实用技巧】为模板增加前端控制①——自动生成页面标题 【MasterPages实用技巧】使用MasterPages实现Web窗体模板 CS研究笔记-缓存 (转) Community Server专题四:HttpHandler Community Server专题八:MemberRole之Membership (转) 主板故障的分析和诊断 http://www.metabuilders.com/ 的MasterPages 控件可以多重嵌套 动态加载用户控件的组件!(转) 自定义控件主题使用研究 MasterPages(转载) 我的野外拍摄
c# arraylist functions
零点时刻 · 2006-04-06 · via 博客园 - 零点时刻

When you put then in the array list you could check to see if the item already exists.  This code snippet will check to see if the string is already in the array and will only add it when the item doesn't already exist in the list.

static void Main( string[] args )
{
 ArrayList list = new ArrayList();

 AddToList( list, "Table1" );
 AddToList( list, "Table4" );
 AddToList( list, "Table1" );
 AddToList( list, "Table3" );
 AddToList( list, "Table2" );
 AddToList( list, "Table2" );

foreach ( string s in list ) //this will loop the collection to show there are no duplicates
 {
  Console.WriteLine( s );
 }
}

private static void AddToList( ArrayList list, string p )
{
 if ( list.Contains( p ) == false )
  list.Add( p );
}