Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a Dictionary contains a given value?

Tags:

vb.net

How do I check if a value exists in a Dictionary(Of int, String)?

Let’s say I have [{1, 'One'};{2, 'Two'};{3, 'Three'}], how to check if ‘Two’ exists ?

like image 911
Amal Avatar asked Jul 17 '15 09:07

Amal


1 Answers

You can use ContainsValue:

If myDictionary.ContainsValue("Two") Then
    debug.print("Exists")
End If

That’s all you need.

like image 192
raed Avatar answered Nov 16 '22 14:11

raed