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

13
LINES

< > BotCompany Repo | #1016884 // tok_splitAtComma - split string at commas honoring tokens. results are trimmed

JavaX fragment (include)

1  
static L<S> tok_splitAtComma(S s) {
2  
  ret tok_splitAtComma(javaTok(s));
3  
}
4  
  
5  
static L<S> tok_splitAtComma(L<S> tok) {
6  
  new L<S> out;
7  
  for i over tok: {
8  
    int j = smartIndexOf(tok, ",", i);
9  
    out.add(joinSubList(tok, i+1, j-1));
10  
    i = j;
11  
  }
12  
  ret out;
13  
}

Author comment

Began life as a copy of #1008393

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016884
Snippet name: tok_splitAtComma - split string at commas honoring tokens. results are trimmed
Eternal ID of this version: #1016884/6
Text MD5: eed03553b77a24cc4091d6d14ec2effe
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-09 13:45:50
Source code size: 273 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 361 / 434
Version history: 5 change(s)
Referenced in: [show references]