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

8
LINES

< > BotCompany Repo | #1012547 // tok_groupAroundWord - ignores case

JavaX fragment (include)

static S tok_groupAroundWord(S s, S word) {
  L<S> tok = defaultTok(s);
  int i = indexOfIC(tok, word);
  if (i < 0) ret s;
  ret curlyBraceIfMoreThanOneToken(joinSubList(tok, 1, i-1))
    + joinSubList(tok, i-1, i+2)
    + curlyBraceIfMoreThanOneToken(joinSubList(tok, i+2));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012547
Snippet name: tok_groupAroundWord - ignores case
Eternal ID of this version: #1012547/4
Text MD5: 870d88ee9d287a0f30c02c39219401f1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-06 23:52:08
Source code size: 285 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 361 / 391
Version history: 3 change(s)
Referenced in: [show references]