I have a dictionary where the key is string and the value is a list of strings.
Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>() {
{"alpha", new List<string> {"one", "two", "three"}}
{"beta", new List<string> {"four", "five", "six"}}
{"gamma", new List<string> {"seven", "eight", "nine"}}
}
Is there a way to return the key when given a string that exist in the value?
For example, given "four"
, return "beta"
I found something like this, but it works only when the value is single and not a list, and I don't know how I can do this with a list.
Thanks.