Public Sub ArrayListExample()
   Dim arlist1 As New ArrayList
   arlist1.Add("abc")
   arlist1.Add("def")
   arlist1.Add("ghi")
   arlist1.Add("jkl")
   arlist1.Add("mno")
   arlist1.Add("pqr")
   arlist1.Add("ghi") ' this is a dupe
   Dim xc = arlist1.Count
   Dim b1 = arlist1.Contains("xyz") ' should be false
   Dim b2 = arlist1.Contains("def") ' should be true
   Dim xi = arlist1.IndexOf("def")
   arlist1.Item(xi) = "stu" ' set the value if index xi
   b2 = arlist1.Contains("def") ' should be false
   Dim b3 = arlist1.Contains("stu") ' true because replaced def
   Dim xi2 = arlist1.IndexOf("ghi")
   Dim xl = arlist1.LastIndexOf("ghi")
 End Sub
 

Below is my locals window

10/04/2015
ArrayList example #1
TheLonelyProgrammer.Net
Alone in a sea of non-programmers
Home ArrayList 1 ArrayList 2 Queues Stacks