Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1014813 // lpad - pad (prepend empty characters)

JavaX fragment (include)

static S lpad(S s, int l) {
  ret lpad(s, l, ' ');
}

static S lpad(S s, int l, char c) {
  if (s == null) s = "";
  ret s.length() >= l ? s : rep(c, l-s.length()) + s;
}

static S lpad(int l, S s) {
  ret lpad(s, l);
}

Author comment

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: 391 / 441
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)