Libraryless. Click here for Pure Java version (2358L/15K).
1 | static L<S> tok_splitAtCommaOrAnd(S s) { |
2 | ret tok_splitAtCommaOrAnd(javaTok(s)); |
3 | } |
4 | |
5 | static L<S> tok_splitAtCommaOrAnd(L<S> tok) { |
6 | new L<S> out; |
7 | for i over tok: { |
8 | int j = smartIndexOfAnyIC(tok, i, ",", "and"); |
9 | out.add(joinSubList(tok, i+1, j-1)); |
10 | while (j < l(tok) && eqicOneOf(tok.get(j+2), ",", "and")) j += 2; |
11 | i = j; |
12 | } |
13 | ret out; |
14 | } |
Began life as a copy of #1016884
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025633 |
Snippet name: | tok_splitAtCommaOrAnd - split at ",", "and" or ", and" |
Eternal ID of this version: | #1025633/4 |
Text MD5: | 5c267859ba97a2e4987520aca914ef9b |
Transpilation MD5: | 379b6007525ee6084bc486b568ced62e |
Author: | stefan |
Category: | javax / parsing |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-10-10 01:28:53 |
Source code size: | 371 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 196 / 289 |
Version history: | 3 change(s) |
Referenced in: | [show references] |