Hey,
So, I have a generic dictionary (key = name, value = linkedlist).
public Dictionary> myDictionary = new Dictionary>();
I know how to insert values into the linkedlist (the value part of the dictionary), however, I do not know how to retrieve/display them. I have managed to retrieve the first, and last entries within the linkedlist through this:
entry.Value.First.Value entry.Value.Last.Value
^the above code is placed within a foreach loop of the dictionary.
I want to input an unspecific amount of entries into the linkedlist, and be able to put them all into 1 string, or display them.
How can I do this? Is it possible? I have been stuck for far too long now, please help :)
VulpesPosted Apr 17, 2014, 5:07 AM
I've also shown how you can combine the elements of a LinkedList
The output is:
Jignesh TrivediPosted Apr 16, 2014, 11:41 PM
Hi,
Try followinf code it might help you.
Dictionary> dic = new Dictionary>(); { "a", "b", "c", "d" }); { "a1", "b1", "c1", "d1" });
dic.Add("test", new List
dic.Add("test1", new List
var rd = dic["test"];
foreach (var r in rd)
{
Console.WriteLine(r);
}