Libraryless. Click here for Pure Java version (1642L/11K).
1 | sS ellipsisToDotPlusRegexp(S s) { |
2 | int i = 0; |
3 | new StringBuffer buf; |
4 | while (i < l(s)) { |
5 | int j = smartIndexOf(s, "...", i); |
6 | buf.append(regexpQuote(substring(s, i, j))); |
7 | if (j >= l(s)) break; |
8 | buf.append(".+"); |
9 | i = j+3; |
10 | } |
11 | ret str(buf); |
12 | } |
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: | 188 / 283 |
Version history: | 1 change(s) |
Referenced in: | [show references] |