Libraryless. Click here for Pure Java version (2500L/16K).
1 | sS newLinesToSpaces_keepCharCount(S s) { |
2 | int n = l(s); |
3 | StringBuilder buf = new(n); |
4 | for i to n: { |
5 | char c = s.charAt(i); |
6 | if (c == '\t' || c == '\r' || c == '\n') |
7 | c = ' '; |
8 | buf.append(c); |
9 | } |
10 | ret str(buf); |
11 | } |
Began life as a copy of #1014697
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1029516 |
Snippet name: | newLinesToSpaces_keepCharCount |
Eternal ID of this version: | #1029516/3 |
Text MD5: | 344967ec11780375f3e4424d4e070495 |
Transpilation MD5: | b5467ca77677946ab9c84a415ccf611f |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-08-16 20:24:27 |
Source code size: | 239 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 177 / 268 |
Version history: | 2 change(s) |
Referenced in: | [show references] |