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

13
LINES

< > BotCompany Repo | #1022427 // splitTokens

JavaX fragment (include)

1  
static LS mapLike splitTokens(O splitter, LS tok) {
2  
  new LS out;
3  
  LS l;
4  
  for i over tok:
5  
    if (odd(i) && l(l = (LS) callF(splitter, tok.get(i))) > 1) {
6  
      for j over l: {
7  
        if (j > 0) out.add("");
8  
        out.add(l.get(j));
9  
      }
10  
    } else
11  
      out.add(tok.get(i));
12  
  ret out;
13  
}

Author comment

Began life as a copy of #1022420

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: #1022427
Snippet name: splitTokens
Eternal ID of this version: #1022427/3
Text MD5: 21dc7b8d11d30998cfecd0197ffc2eac
Author: stefan
Category: javax / tokenizing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-17 10:51:06
Source code size: 308 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 305 / 310
Version history: 2 change(s)
Referenced in: [show references]