Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to delete all elements from hashmap in java except one

map.keySet().removeIf(k -> !(k.equals(Constants.search) || k.equals(Constants.context)));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #elements #hashmap #java
ADD COMMENT
Topic
Name
2+1 =