Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1009134 // dropKeysStartingWith - drop elements of a map with keys starting with X

JavaX fragment (include)

1  
static <V> Map<S, V> dropKeysStartingWith(S prefix, Map<S, V> map) {
2  
  Map<S, V> map2 = similarEmptyMap(map);
3  
  for (S key : map.keySet())
4  
    if (!startsWith(key, prefix))
5  
      map2.put(key, map.get(key));
6  
  ret map2;
7  
}

Author comment

Began life as a copy of #1002560

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009134
Snippet name: dropKeysStartingWith - drop elements of a map with keys starting with X
Eternal ID of this version: #1009134/2
Text MD5: d85241dfdca9f45551b34a5c8e3ac3e6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-04 17:47:36
Source code size: 227 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 492 / 499
Version history: 1 change(s)
Referenced in: [show references]