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

11
LINES

< > BotCompany Repo | #1017691 // splitAtTokens_once (first occurrence, returns null if list not found)

JavaX fragment (include)

1  
static Pair<S> splitAtTokens_once(S s, LS tokens) {
2  
  ret splitAtTokens_once(javaTok(s), tokens);
3  
}
4  
5  
static Pair<S> splitAtTokens_once(L<S> tok, LS tokens) {
6  
  int i = indexOfSubList(tok, tokens, 0);
7  
  if (i < 0) null;
8  
  ret pair(
9  
    trimJoinSubList(tok, 0, i),
10  
    trimJoinSubList(tok, i+l(tokens)));
11  
}

Author comment

Began life as a copy of #1017544

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017691
Snippet name: splitAtTokens_once (first occurrence, returns null if list not found)
Eternal ID of this version: #1017691/1
Text MD5: 564dba45e408e08883d1ed4cce4efa63
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-03 13:56:27
Source code size: 314 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 368 / 411
Referenced in: [show references]