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)

static L<S> tok_splitAtComma(S s) {
  ret tok_splitAtComma(javaTok(s));
}
  
static L<S> tok_splitAtComma(L<S> tok) {
  new L<S> out;
  for i over tok: {
    int j = smartIndexOf(tok, ",", i);
    out.add(joinSubList(tok, i+1, j-1));
    i = j;
  }
  ret out;
}

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: 434 / 507
Version history: 5 change(s)
Referenced in: [show references]