Remove Method

Removes the first occurrence of a specific Element from the ArrayList object.

Syntax

Object.Remove(Element)

Arguments:

  • Object: Required. Always the name of ArrayList object.

  • Element: Required. The Element to remove from the ArrayList object.

Remarks

The following example illustrates the use of the Remove method.

Example 1:


'Create ArrayList Object
Dim Obj
Set Obj = CreateObject("System.Collections.ArrayList")

'Add Elements to the end of ArrayList Object
Dim Index
Index = Obj.Add(10)
Index = Obj.Add(40)
Index = Obj.Add(20)
Index = Obj.Add(30)

'Output: Obj contains 10, 40, 20, 30

'Remove Element from the ArrayList Object
Obj.Remove(20)
'Output: Obj contains 10, 40, 30