VKinfotek Inc.
  • Us
    About Us
    Contact Us
  • FAQs
  • Ready Software
    Ready ERP ASP Core Software for Azure Cloud
    Ready Web ERP Software
    Ready ASP.Net Azure Software
    Ready C# SQL Server Accounting Software
    Ready ASP.Net MVC and EF Software
First slide
Earn $100/hour in USA! Click Here

find item in arraylist using indexof method

IndexOf method is used to determine if a particular item exists in an ArrayList. If an item exists, the index of that item is returned and if the item does not exist, -1 is returned.



private void Form1_Load(object sender, EventArgs e)
{
	ArrayList arrayList = new ArrayList();
	arrayList.Add("Customer1");
	arrayList.Add("Customer2");
	arrayList.Add("Customer3");
	arrayList.Add("Customer4");
	arrayList.Add("Customer5");
	MessageBox.Show(arrayList.IndexOf("Customer1").ToString());
}

The above statement returns zero because "Customer1" is the first item in the ArrayList.


ArrayList Articles
  • retrieve arraylist items using enumerators
  • retrieve arraylist items using for each loop
  • retrieve arraylist items using indexers
  • insert items to the arraylist using insert and insertrange method
  • remove items from arraylist
  • bind arraylist with gridview control in asp net application
  • how to bind arraylist with dropdownlist in asp net application
  • how to bind arraylist with radiobuttonlist in asp.net application
  • convert arraylist to string array
  • <a href="/arraylist/convert-string-a