SoFunction
Updated on 2025-03-10

VBS Tutorial: Method - Remove Method

Remove method

fromDictionaryDelete key and item pairs in the object.

object.Remove(key)

parameter

object

Required option. Should beDictionaryThe name of the object.

key

Required option. WithDictionaryThe keys and item pairs associated with deleted in an objectKey

illustrate

An error occurs if the specified key and item pair does not exist.

The following code demonstrates how to use itRemovemethod:

Dim a, d                    'Create variables。Set d = CreateObject("") "a", "Athens"         'Add keys and items。 "b", "Belgrade" "c", "Cairo"...a = d.Remove("b")            'Delete the second item pair