Remove(Key: String);
Key. Element key that should be removed.
The Remove method removes element by the specified key.
Sub UserProc;
Var
StrMap: IStringMap;
i: Integer;
Begin
StrMap := New StringMap.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
StrMap.Add("Key_" + Math.RandBetweenI(0, 100).ToString, "Value " + Math.RandBetweenI(0, 100).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: