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

12
LINES

< > BotCompany Repo | #1008718 // replaceIC - replace element in list (ignoring case); also replace substrings

JavaX fragment (include)

static L<S> replaceIC(L<S> l, S a, S b) {
  new L<S> l2;
  for i over l: {
    S s = l.get(i);
    l2.add(eqic(s, a) ? b : s);
  }
  ret l2;
}

static S replaceIC(S s, S a, S b) {
  ret s.replaceAll("(?i)" + patternQuote(a), quoteReplacement(b));
}

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: #1008718
Snippet name: replaceIC - replace element in list (ignoring case); also replace substrings
Eternal ID of this version: #1008718/5
Text MD5: 69bc498919408bad678a2cfbd514dcb2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-31 04:45:41
Source code size: 259 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 596 / 635
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)