Metodo RemoveAt

Rimuove l'elemento nell'indice specificato dell'oggetto ArrayList.

Sintassi

Object.RemoveAt(Index)

Argomenti:

  • Object: obbligatorio. Sempre il nome dell'oggetto ArrayList.

  • Index: obbligatorio. Indice su base zero dell'elemento da rimuovere.

Note

Nell'esempio seguente viene illustrato l'uso del metodo RemoveAt.

Esempio 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)


'Remove Element from the ArrayList Object
Index = 3
If index < Obj.Count() Then
Obj.RemoveAt(Index)
End If

'Display ArrayList Elements after Remove
For Each Element In Obj
'Operation based on requirement with the Element 
Next
'Output: Obj contains 10, 40, 20