Item(Key: String): String;
Key - element key.
The Item property determines value of the element, which key is passed by the Key parameter.
Sub Main;
Var
StrMap: IStringMap;
i: Integer;
s: String;
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;
s:=StrMap.Item(StrMap.Key(StrMap.Count-1));
End Sub Main;
After executing the example a map of strings is generated, elements with repeated keys are overwritten, and the "s" variable contains value of the last element.
See also: