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

13
LINES

< > BotCompany Repo | #1008378 // asteriskPartsOnly

JavaX fragment (include)

1  
static S asteriskPartsOnly(S s) {
2  
  L<S> tok = javaTokC(s);
3  
  replaceSubList(tok, ll("*", "*"), ll("*"));
4  
  new L<S> words;
5  
  int i = 0;
6  
  while ((i = indexOf(tok, "*", i)) >= 0) {
7  
    int j = indexOf(tok, "*", ++i);
8  
    if (j < 0) break;
9  
    words.addAll(subList(tok, i, j));
10  
    i = j+1;
11  
  }
12  
  ret joinWithSpace(words);
13  
}

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: #1008378
Snippet name: asteriskPartsOnly
Eternal ID of this version: #1008378/1
Text MD5: c245a011c5dd77010713325ae153a7ce
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-10 01:11:18
Source code size: 335 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 547 / 564
Referenced in: [show references]