// map the key (key) iterator object
the Iterator <String> = myMap.keySet Iterator () Iterator ();.
The while (iterator.hasNext ()) {// cycle taking key judgment
String key = iterator. next (); // key
IF (key.startsWith ( "Week")) {
the Iterator.remove (); // remove the key map to begin with a character corresponding to the key-value
}
IF (key.startsWith ( " lessonNo ")) {
the Iterator.remove (); // remove the key map corresponding to the beginning character of a key value
}
}
source: https://blog.csdn.net/qq_37584445/article/details/88681622
Remove key-value pairs specified in the Map
Guess you like
Origin www.cnblogs.com/XiaoheBlogs/p/12335981.html
Recommended
Ranking