c# - Remove item from dictionary where value is empty list -
what best way remove item dictionary value empty list?
idictionary<int,ilist<t>>
var foo = dictionary .where(f => f.value.count > 0) .todictionary(x => x.key, x => x.value);
this create new dictionary. if want remove in-place, jon's answer trick.
Comments
Post a Comment