marbroer
(Marcel Broersen)
June 29, 2018, 8:35am
1
Is is possible to have 2 values for one name?
So
Name Value1 Value2
I need this for selection a template.
First I check if an EmailFrom contains a specific @…
Which is specified in the configfile and thus thus received in dictionary.
From this same Config file I will receive the template name for this.
So it should be handy when Dictionary can have 2 values.
sarathi125
(Parthasarathi)
June 29, 2018, 9:00am
2
Hi,
Yes you can have two values for one Key, try to have your dictionary as per the below syntax,
Dictionary(Of String, IEnumerable(Of String))
Mr_JDavey
(Joshua Davey)
June 29, 2018, 9:05am
3
Hi here @marbroer ,
Definitely, as noted by @sarathi125 , you can include a collection within the entry value.
This could be an Array, List, or an IEnumerable (for example), as stated above.
Thanks in advance,
Josh
marbroer
(Marcel Broersen)
June 29, 2018, 9:11am
4
Ok, that is great, and how do I refer to the second or third value?
Uemoe
(Konstantin Marushchak)
July 3, 2018, 3:31am
5
In your case better option use Dictionary(Of String, Tuple(Of String, String)).
dict = New Dictionary(Of String, Tuple(Of String, String)() From { {“key1”, Tuple.Create(“Value1”, “Value2”)}, {“key2”, Tuple.Create(“Value3”, “Value4”)} }
to get value back:
dict(“key1”).Item1 - return “Value1”,
dict(“key1”).Item2 return “Value2”
Hello pleeeeaase I need this help me with a sample sequence…sample sequnce to load such dictionary from excel
Uemoe:
{ {“key1”, Tuple.Create(“Value1”, “Value2”)}, {“key2”, Tuple.Create(“Value3”, “Value4”)} }
I tried the same but it is not working the is missing of ‘)’
can you Please provide any sample xaml
1 Like