IStringMap.Remove

Syntax

Remove(Key: String);

Parameters

Key. Element key that should be removed.

Description

The Remove method removes element by the specified key.

Example

Sub UserProc;
Var
    StrMap: IStringMap;
    i: Integer;
Begin
    StrMap := New StringMap.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrMap.Add("Key_" + Math.RandBetweenI(0100).ToString, "Value " + Math.RandBetweenI(0100).ToString);
    End For;
    StrMap.Remove(StrMap.Key(StrMap.Count - 1));
End Sub UserProc;

After executing the example a string map of random size is generated, elements with repeated keys are overwritten. The last element of the map is removed.

See also:

IStringMap