How to get the keys on the basis of corresponding values

Hello , I have a dictionary of type (Integer , string) where key is index of row and value is its string value.

I need to get the keys on the basis of value

Column 0
1 London
2 Paris
3 Newyork

If we have newyork , I want 3 as key

Kindly have a view on this thread

Cheers @Karan28

yes I saw that , any other way??


If you need to get the key based on its value, then you can try like this.

yourDictionary.FirstOrDefault(Function(x) x.Value.Contains("passvaluehere")).Key

what is x here?

Its Linq Lambda expression, check this link for more details on it.

Okay Thankyou for the reply , I appreciate it

1 Like

Please mark the solution as resolved if it is helped and resolved your issue. Let me know in case of issues.