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

13
LINES

< > BotCompany Repo | #1022427 // splitTokens

JavaX fragment (include)

static LS mapLike splitTokens(O splitter, LS tok) {
  new LS out;
  LS l;
  for i over tok:
    if (odd(i) && l(l = (LS) callF(splitter, tok.get(i))) > 1) {
      for j over l: {
        if (j > 0) out.add("");
        out.add(l.get(j));
      }
    } else
      out.add(tok.get(i));
  ret out;
}

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: 304 / 309
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1025441 - splitTokensWithSpaces