1 | static S multiReplace(S s, S... replacements) {
|
2 | if (s == null) null; |
3 | for (int i = 0; i+1 < l(replacements); i += 2) |
4 | s = s.replace(replacements[i], replacements[i+1]); |
5 | ret s; |
6 | } |
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: | #1006858 |
| Snippet name: | multiReplace - apply multiple string replaces |
| Eternal ID of this version: | #1006858/1 |
| Text MD5: | fa9ce4d847b7b993695bcfdeb2b5e58d |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-02-10 19:44:10 |
| Source code size: | 190 bytes / 6 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 759 / 781 |
| Referenced in: | [show references] |