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

12
LINES

< > BotCompany Repo | #1002147 // splitListBy

JavaX fragment (include)

1  
static L<L<S>> splitListBy(L<S> l, S sep) {
2  
  int i = 0;
3  
  new L<L<S>> x;
4  
  while (i < l(l)) {
5  
    int j = indexOf(l, sep, i);
6  
    if (j < 0) j = l(l);
7  
    if (j > i)
8  
      x.add(l.subList(i, j));
9  
    i = j+1;
10  
  }
11  
  ret x;
12  
}

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: #1002147
Snippet name: splitListBy
Eternal ID of this version: #1002147/1
Text MD5: 836aa5953e9153c92cb724bdf45238d4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-22 00:01:18
Source code size: 235 bytes / 12 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 680 / 928
Referenced in: [show references]