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

9
LINES

< > BotCompany Repo | #1021387 // splitAtTokenIndices - assumes one split token

JavaX fragment (include)

1  
static L<S> splitAtTokenIndices(LS tok, L<Int> indices) {
2  
  new L<S> l;
3  
  for (int iI = -1; iI < l(indices); iI++) {
4  
    int i = or(get(indices, iI), 0)+1;
5  
    int j = or(get(indices, iI+1), l(tok));
6  
    l.add(trimJoin(tok.subList(i, j)));
7  
  }
8  
  ret l;
9  
}

Author comment

Began life as a copy of #1017544

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021387
Snippet name: splitAtTokenIndices - assumes one split token
Eternal ID of this version: #1021387/6
Text MD5: 2d5e4751aca16f52fd352ad16c613a2d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-10 17:56:13
Source code size: 262 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 371 / 381
Version history: 5 change(s)
Referenced in: [show references]