embedding dictionary withing another one?
-
What is the syntax to embed a dictionary within another dictionary? Dictionary dicText = new Dictionary();
-
What is the syntax to embed a dictionary within another dictionary? Dictionary dicText = new Dictionary();
Umm, how about this:
Dictionary<string, Dictionary<string, MyClass>> dict = new Dictionary<string, Dictionary<string, MyClass>>();
-
Umm, how about this:
Dictionary<string, Dictionary<string, MyClass>> dict = new Dictionary<string, Dictionary<string, MyClass>>();
thanks dude. got this far, but now how do i insert into the 1st and 2nd respectively? dict.add("afdfs", ?)
-
thanks dude. got this far, but now how do i insert into the 1st and 2nd respectively? dict.add("afdfs", ?)
Well, in the embedded one you have to create a dictionary.
dict.Add("key1", new Dictionary());
dict["key1"].Add("key2", new MyClass(1234));
-
thanks dude. got this far, but now how do i insert into the 1st and 2nd respectively? dict.add("afdfs", ?)
don't worry I know how to do it. dict.add("asdfad", dicC.add("asdsfa","asdf") thanks anyway