So I have set up my Dictionary as follow:
Dictionary<string[], string> d = new Dictionary<string[], string>();
d.Add(new[] { "email@yahoo.com", "test@yahoo.com" }, "Group 1");
d.Add(new[] { "myemail@gmail.com", "checkit@gmail.com" }, "Group 2");
string keycheck = "email@yahoo.com";
string val = "";
d.TryGetValue(keycheck, out string k);
I get the following error:
Argument 1: cannot convert from 'string' to 'string[]' (CS1503) (Project1)
which make sense since the key in the Dictionary is an String array.
How can I update my code so I can find the value in the Dictionary based on the email string.
So if the keycheck
is provided above, the return value should be Group 1