Libraryless. Click here for Pure Java version (4532L/25K).
1 | sS regularSpecialLineBreaks(int charsPerLine, S lineBreak, S s) { |
2 | if (l(s) < charsPerLine) ret s; |
3 | |
4 | new StringBuilder buf; |
5 | int n = l(s), j = 0; |
6 | |
7 | for i to n: { |
8 | buf.append(s.charAt(i)); |
9 | if (++j >= charsPerLine) { |
10 | buf.append(lineBreak); |
11 | j = 0; |
12 | } |
13 | } |
14 | |
15 | ret str(buf); |
16 | } |
Began life as a copy of #1033233
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033459 |
Snippet name: | regularSpecialLineBreaks |
Eternal ID of this version: | #1033459/1 |
Text MD5: | 8d75d864ef22de678764189e97ca9705 |
Transpilation MD5: | 23ac0fa1e8976233e318907e8e001ce2 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-28 21:11:54 |
Source code size: | 315 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 161 / 217 |
Referenced in: | [show references] |