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

11
LINES

< > BotCompany Repo | #1008771 // replaceRangesWithXYZVars

JavaX fragment (include)

static S replaceRangesWithXYZVars(S s, L<IntRange> ranges) {
  new StringBuilder buf;
  int i = 0, varIndex = 0;
  for (IntRange r : ranges) {
    if (i < r.start) buf.append(substring(s, i, r.start));
    buf.append(xyzVar(++varIndex));
    i = r.end;
  }
  if (i < l(s)) buf.append(substring(s, i));
  ret str(buf);
}

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: #1008771
Snippet name: replaceRangesWithXYZVars
Eternal ID of this version: #1008771/1
Text MD5: 3f38efce3bcb8d5edbf1f67f97fba05d
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-02 12:16:56
Source code size: 329 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 465 / 524
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)