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

8
LINES

< > BotCompany Repo | #1032150 // jreplace_multi_withModifier

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

Libraryless. Click here for Pure Java version (3874L/22K).

sS lambdaMapLike jreplace_multi_withModifier(IF1<O> modifier, S s, O... replacements) {
  if (empty(replacements)) ret s;
  if (modifier == null) ret jreplace_multi_gen(s, replacements);
  O[] a = new O[replacements.length];
  for i over a:
    a[i] = even(i) ? replacements[i] : modifier.get(replacements[i]);
  ret jreplace_multi_gen(s, a);
}

Author comment

Began life as a copy of #1032146

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032150
Snippet name: jreplace_multi_withModifier
Eternal ID of this version: #1032150/1
Text MD5: 8dba0cae5d6401b0296322060b223be3
Transpilation MD5: ba19c2a1585f8ebc89083d872bf3cbb3
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-14 11:07:22
Source code size: 351 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 148 / 205
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)