C# Remove item from nested dictionary -


i've got simple question mind drawing blank to: have dictionary looks this:

dictionary<string, dictionary<string, string>> dict; 

as far know, dict.remove() remove entry key, need remove item innermost dictionary. how go that?

well presumably you've got 2 keys: 1 outer dictionary , 1 nested one.

so assuming know entry present, can use

dict[outerkey].remove(innerkey); 

if don't know whether entry exists, want like:

dictionary<string, string> innerdict; if (dict.trygetvalue(outerkey, out innerdict)) {     // doesn't matter whether or not innerkey exists beforehand     innerdict.remove(innerkey); } 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -