1 | sS replaceAnyPrefix(S replacement, S s, S... prefixes) { |
2 | for (S prefix : prefixes) |
3 | if (startsWith(s, prefix)) |
4 | ret replacement + substring(s, l(prefix)); |
5 | ret s; |
6 | } |
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: | 336 / 363 |
Version history: | 1 change(s) |
Referenced in: | [show references] |