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

12
LINES

< > BotCompany Repo | #1024108 // ellipsisToDotPlusRegexp

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

Libraryless. Click here for Pure Java version (1642L/11K).

sS ellipsisToDotPlusRegexp(S s) {
  int i = 0;
  new StringBuffer buf;
  while (i < l(s)) {
    int j = smartIndexOf(s, "...", i);
    buf.append(regexpQuote(substring(s, i, j)));
    if (j >= l(s)) break;
    buf.append(".+");
    i = j+3;
  }
  ret str(buf);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1024108
Snippet name: ellipsisToDotPlusRegexp
Eternal ID of this version: #1024108/2
Text MD5: 51f7adcea935615285e96a212dd55948
Transpilation MD5: 0b57481ba1a525154575463386d59d3c
Author: stefan
Category: javax / stefan's os / a.i. / web
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-20 20:51:30
Source code size: 273 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 118 / 193
Version history: 1 change(s)
Referenced in: [show references]