IDictionary.Remove

Syntax

Remove(Key: Variant);

Parameters

Key. Key of the element that should be removed.

Description

The Remove method removes element with the Key key.

Example

Sub Main;

Var

Hast: IHashtable;

Dict: IDictionary;

CKeys: ICollection;

i: Integer;

Begin

Hast:=New Hashtable.Create;

Dict:=Hast As IDictionary;

For i:=0 To 100 Do

Dict.Add(i,Math.RandBetween(0,100));

End For;

Dict.Remove(Math.RandBetweenI(0,100));

End Sub Main;

After executing the example the glossary that contains random numbers from 0 to 100 is created, and the element with random key is removed.

See also:

IDictionary