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)

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

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: 398 / 411
Version history: 1 change(s)
Referenced in: [show references]