System.Generics.Collections.TDictionary.TryGetValue

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function TryGetValue(const Key: K; var Value: V): Boolean;

C++

bool __fastcall TryGetValue(const K Key, V &Value);

Properties

Type Visibility Source Unit Parent
function public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TDictionary

Description

Try to get value for key.

TryGetValue returns true if the given key is in the dictionary and provides its value in Value. Otherwise, it returns false and Value is set to the default value type of TValue. No exception is raised if the key is not in the dictionary. This is an O(1) operation.

See Also