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

12
LINES

< > BotCompany Repo | #1017598 // combineWithGlobalIDs

JavaX fragment (include)

static L<PairS> combineWithGlobalIDs(L<S> l) {
  new L<PairS> out;
  for (int i = 0; i < l(l); i++) {
    if (i < l(l)-1) {
      S id = regexpFirstGroup("^\\[id: (" + regexp_globalID() + ")\\]$", trim(l.get(i)));
      if (id != null)
        continue with out.add(pair(id, l.get(++i)));
    }
    out.add(pair("", l.get(i)));
  }
  ret out;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017598
Snippet name: combineWithGlobalIDs
Eternal ID of this version: #1017598/1
Text MD5: a35361176d8db127780d8c5d95b9d4e4
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-29 01:56:58
Source code size: 355 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 334 / 367
Referenced in: [show references]