IDictionary.Remove

Syntax

Remove(Key: Variant);

Parameters

Key. Key of the element that should be removed.

Description

The Remove method removes element by the specified key.

Example

Sub Main;
Var
    Hast: IHashtable;
    i: Integer;
Begin
    Hast := New Hashtable.Create;
    For i := 0 To 100 Do
        Hast.Add(i, Math.RandBetween(0100));
    End For;
    Hast.Remove(Math.RandBetweenI(0100));
End Sub Main;

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

See also:

IDictionary