令狐不聪 通过本文主要向大家介绍了c#arraylist的用法,c#arraylist,c#中arraylist用法,c#中arraylist,c#arraylist头文件等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
本文实例讲述了C#查找对象在ArrayList中出现位置的方法。分享给大家供大家参考。具体分析如下:
我们可以通过IndexOf方法来查找对象在ArrayList中的位置
ArrayList alcollect = new ArrayList(); // Add individual items to the collection string str = "learn csharp"; alcollect.Add(str); //find position of object Console.WriteLine(alcollect.IndexOf(str));</div>
希望本文所述对大家的C#程序设计有所帮助。
</div>