1 | static int indent_default = 2; |
2 | |
3 | static String indent(int indent) { |
4 | return repeat(' ', indent); |
5 | } |
6 | |
7 | static String indent(int indent, String s) { |
8 | return indent(repeat(' ', indent), s); |
9 | } |
10 | |
11 | static String indent(String indent, String s) { |
12 | return indent + replace(unnull(s), "\n", "\n" + indent); |
13 | } |
14 | |
15 | static String indent(String s) { |
16 | return indent(indent_default, s); |
17 | } |
18 | |
19 | static L<S> indent(S indent, L<S> lines) { |
20 | new L<S> l; |
21 | if (lines != null) for (S s : lines) |
22 | l.add(indent + s); |
23 | ret l; |
24 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1000672 |
Snippet name: | indent function |
Eternal ID of this version: | #1000672/4 |
Text MD5: | 6a6c13b9fb688c44e6eda8c075a5c521 |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-11-01 23:11:23 |
Source code size: | 523 bytes / 24 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 851 / 1818 |
Version history: | 3 change(s) |
Referenced in: | [show references] |