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

15
LINES

< > BotCompany Repo | #1011989 // splitAtDoubleArrow - javaTok and split at "=>" (and trim)

JavaX fragment (include)

1  
static L<S> splitAtDoubleArrow(S s) {
2  
  ret splitAtDoubleArrow(javaTok(s));
3  
}
4  
5  
static L<S> splitAtDoubleArrow(L<S> tok) {
6  
  new L<S> l;
7  
  int i = 0;
8  
  while (i < l(tok)) {
9  
    int j = indexOfSubList(tok, splitAtDoubleArrow_tok(), i);
10  
    if (j < 0) j = l(tok);
11  
    l.add(trimJoin(tok.subList(i, j)));
12  
    i = j+3;
13  
  }
14  
  ret l;
15  
}

Author comment

Began life as a copy of #1008581

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1011989
Snippet name: splitAtDoubleArrow - javaTok and split at "=>" (and trim)
Eternal ID of this version: #1011989/9
Text MD5: 95ab7e0df7a5b0a764e94349043787d0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-20 21:07:47
Source code size: 342 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 482 / 518
Version history: 8 change(s)
Referenced in: [show references]