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

16
LINES

< > BotCompany Repo | #1018186 // splitAtSingleArrow - javaTok and split at "->" (and trim)

JavaX fragment (include)

static L<S> splitAtSingleArrow(S s) {
  ret splitAtSingleArrow(javaTok(s));
}

static L<S> splitAtSingleArrow(L<S> tok) {
  new L<S> l;
  int i = 0;
  while (i < l(tok)) {
    int j = indexOfSubList(tok, ll("-", "", ">"), i);
    if (i >= l(tok)) break;
    if (j < 0) j = l(tok);
    l.add(trimJoin(tok.subList(i, j)));
    i = j+3;
  }
  ret l;
}

Author comment

Began life as a copy of #1011989

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018186
Snippet name: splitAtSingleArrow - javaTok and split at "->" (and trim)
Eternal ID of this version: #1018186/1
Text MD5: 541f703c9b25b19f46f5d03a302215d3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-07 20:06:00
Source code size: 363 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 316 / 357
Referenced in: [show references]