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

8
LINES

< > BotCompany Repo | #1030877 // starsToAngleBracketedNumbers

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

Libraryless. Click here for Pure Java version (3097L/18K).

1  
// e.g. "* is *" to "<1> to <2>"
2  
sS starsToAngleBracketedNumbers(S s) {
3  
  LS tok = javaTokWithAngleBrackets(s);
4  
  int count = 0;
5  
  for (int idx : indicesOf(tok, "*"))
6  
    tok.set(idx, angleBracketed(str(++count)));
7  
  ret join(tok);
8  
}

Author comment

Began life as a copy of #1025717

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030877
Snippet name: starsToAngleBracketedNumbers
Eternal ID of this version: #1030877/1
Text MD5: 627c5ded27cde11b138918bb2adfa997
Transpilation MD5: 03e97cf403261b280706ac30fbdb78ed
Author: stefan
Category: javax / tokenizing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-05 16:25:18
Source code size: 240 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 237 / 311
Referenced in: [show references]