So I have a java hashmap like below:
hMap.put(\"1\", \"One\"); hMap.put(\"2\", \"Two\"); hMap.put(\"3\", \"Two\");
I would like to remove A
You can use while( hmap.values().remove("Two") ); since the remove call returns true if the collection was changed as a result of the call.
while( hmap.values().remove("Two") );
true