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

9
LINES

< > BotCompany Repo | #1024054 // tok_splitAtSpacedPlus

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (1988L) is out of date.

static LS tok_splitAtSpacedPlus(S s) {
  new L<Int> indices;
  LS tok = javaTokWithAllBrackets_cached(s);
  for (int i = 1; i < l(tok); i += 2)
    if (eqGet(tok, i, "+") && endsWithOneOf(get(tok, i-1), " ", "\t")
      && startsWithOneOf(get(tok, i+1), " ", "\t"))
      indices.add(i);
  ret splitAtTokenIndices(tok, indices);
}

Author comment

Began life as a copy of #1021388

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1024054
Snippet name: tok_splitAtSpacedPlus
Eternal ID of this version: #1024054/3
Text MD5: cd03b7bb890bc81238a3a890b6b72c66
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-17 14:47:53
Source code size: 338 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 227 / 328
Version history: 2 change(s)
Referenced in: [show references]