1 | static S lpad(S s, int l) { |
2 | ret lpad(s, l, ' '); |
3 | } |
4 | |
5 | static S lpad(S s, int l, char c) { |
6 | if (s == null) s = ""; |
7 | ret s.length() >= l ? s : rep(c, l-s.length()) + s; |
8 | } |
9 | |
10 | static S lpad(int l, S s) { |
11 | ret lpad(s, l); |
12 | } |
Began life as a copy of #1009103
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: | #1014813 |
Snippet name: | lpad - pad (prepend empty characters) |
Eternal ID of this version: | #1014813/4 |
Text MD5: | af0a92cd0e4c878285cf68f7d8a17f17 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-10-03 13:27:37 |
Source code size: | 230 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 461 / 519 |
Version history: | 3 change(s) |
Referenced in: | [show references] |