KeyedCollection<TKey,TItem>.TryGetValue(TKey, TItem) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to get an item from the collection using the specified key.
public:
bool TryGetValue(TKey key, [Runtime::InteropServices::Out] TItem % item);
public bool TryGetValue (TKey key, out TItem item);
member this.TryGetValue : 'Key * 'Item -> bool
Public Function TryGetValue (key As TKey, ByRef item As TItem) As Boolean
Parameters
- key
- TKey
The key of the item to search in the collection.
- item
- TItem
When this method returns true
, the item from the collection that matches the provided key; when this method returns false
, the default
value for the type of the collection.
Returns
true
if an item for the specified key was found in the collection; otherwise, false
.
Exceptions
key
is null
.
Applies to
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.