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

6
LINES

< > BotCompany Repo | #1019461 // replaceAnyPrefix

JavaX fragment (include)

sS replaceAnyPrefix(S replacement, S s, S... prefixes) {
  for (S prefix : prefixes)
    if (startsWith(s, prefix))
      ret replacement + substring(s, l(prefix));
  ret s;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019461
Snippet name: replaceAnyPrefix
Eternal ID of this version: #1019461/2
Text MD5: 6f0cf9604bfce14c4cf03f8a91ba1e2b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-07 01:46:04
Source code size: 180 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 257 / 285
Version history: 1 change(s)
Referenced in: [show references]