1 | static S simpleEmptyLines(S s) {
|
2 | if (s == null) null; |
3 | new L<S> l; |
4 | bool lastEmpty = false; |
5 | for (S line : lines(s)) {
|
6 | if (!emptyAfterTrim(line)) lastEmpty = false; |
7 | else if (lastEmpty) continue; |
8 | else lastEmpty = true; |
9 | l.add(line); |
10 | } |
11 | ret lines(l); |
12 | } |
Began life as a copy of #1013676
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1014353 |
| Snippet name: | simpleEmptyLines - convert multiple empty lines to just one |
| Eternal ID of this version: | #1014353/4 |
| Text MD5: | 153200a411b18674781a4fbb78b8bc17 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-08-31 13:27:54 |
| Source code size: | 284 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 759 / 780 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |