Swift Dictionary with Array of Strings remove Value -
so, have dictionary contains array of strings this:
var dict = ["section1": ["dev1", "dev2"], "section2": ["dev3", "dev4"]] and have able remove value array. example: want remove "dev4" no matter if in "section1" or "section2".
how doing this?
for key in dict.keys { dict[key] = dict[key]!.filter({ $0 != "dev4"}) }
Comments
Post a Comment