ArrayList.Remove : ArrayList « System.Collections « VB.Net by API






ArrayList.Remove

  

Imports System
Imports System.Collections

Public Class MainClass

   Public Shared Sub Main()
      Dim arrayList As arrayList = New arrayList(1)

      arrayList.Add("a")

      try
          Console.WriteLine(arrayList(0))
      Catch outOfRange As ArgumentOutOfRangeException
          Console.WriteLine(outOfRange.ToString())
      End Try

      Console.WriteLine(arrayList.Count)

      Console.WriteLine(arrayList.Contains("a"))
      
      Console.WriteLine(arrayList.IndexOf("a"))

      arrayList.Remove("a")

      arrayList.TrimToSize()
      Console.WriteLine(arrayList.Capacity)

      arrayList.Add("a")

      Dim enumerator As IEnumerator = arrayList.GetEnumerator()

      While enumerator.MoveNext()
         Console.WriteLine(enumerator.Current )
      End While 
   End Sub
End Class

   
    
  








Related examples in the same category

1.ArrayList.Add
2.ArrayList.Capacity
3.ArrayList.Contains
4.ArrayList.Count
5.ArrayList.GetEnumerator
6.ArrayList.IndexOf
7.ArrayList.ToArray()
8.ArrayList.TrimToSize