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

7
LINES

< > BotCompany Repo | #1005110 // replaceAll - replace elements in a list - or String.replaceAll

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1731L/11K).

static <A> L<A> replaceAll(L<A> l, final A a, final A b) {
  ret map(l, func(A x) -> A { eq(x, a) ? b : x });
}

sS replaceAll(S s, S a, S b) {
  ret s == null ? null : s.replaceAll(a, b);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005110
Snippet name: replaceAll - replace elements in a list - or String.replaceAll
Eternal ID of this version: #1005110/4
Text MD5: e059ba54c07e0c46788a368a45e8e944
Transpilation MD5: 01f9ed85fce92a9e04ea91cd3ea67110
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-29 05:42:34
Source code size: 196 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 613 / 688
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)