通过IndexOf方法来查找对象在ArrayList中的位置
2015-04-11 08:29
274 查看
通过IndexOf方法来查找对象在ArrayList中的位置
ArrayList alcollect = new ArrayList();
// Add individual items to the collection
string str = "learn csharp";
alcollect.Add(str);
//find position of object codego.net
Console.WriteLine(alcollect.IndexOf(str));
ArrayList alcollect = new ArrayList();
// Add individual items to the collection
string str = "learn csharp";
alcollect.Add(str);
//find position of object codego.net
Console.WriteLine(alcollect.IndexOf(str));
相关文章推荐
- C#查找对象在ArrayList中出现位置的方法
- lastIndexOf() 找出指定元素出现的所有位置(返回的是下标数组)---lastIndexOf() 这个方法是倒叙查找,正序的是indexOf()
- indexOf() 如何判断一个元素在指定数组中是否存在? 找出指定元素出现的所有位置? indexOf()方法 是正序查找,lastIndexOf()是倒叙查找
- 通过indexOf()查找某个字符串位置
- indexOf 方法返回一个整数值,指出 String 对象内子字符串的开始位置。如果没有找到子字符串,则返回 -1
- ArrayList与LinkedList方法分析一:查找某个对象引用在集合中的索引(index)
- 在servlet存储对象的实列化,然后通过jsp把对象中一个方法返回的是Arraylist集合 数据调用出来
- php通过strpos查找字符串出现位置的方法
- 总结:查找一个对象在列表中位置的方法
- 【Android】ArrayList通过remove方法删除元素对象源码分析
- 对象间通信方法之一:通过委托实现(C#语言)
- 通过四种方法查找字符A
- vector查找对象或指针成员值的方法
- 004 把查找对象的方法放到model里
- 查找文件夹中的所有文件及子文件夹的方法,附源程序,VC7.1下编译运行通过
- Fedora的目录及查找命令位置的方法
- 如何将一个通过LINQ查找出来并重新构造的匿名对象转化成DATATABLE
- 通过SOCKET传递序列化的Java对象的方法 序列化 Socket
- ClientDataSet通过UpdateStatus方法配合Delta属性查找已删除的记录
- 通过spy++查找应用程序菜单对应函数的方法