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

11
LINES

< > BotCompany Repo | #1002634 // rpad - pad (append empty characters)

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (74L) is out of date.

1  
static S rpad(S s, int l) {
2  
  ret rpad(s, l, ' ');
3  
}
4  
5  
static S rpad(S s, int l, char c) {
6  
  ret lengthOfString(s) >= l ? s : s + rep(c, l-lengthOfString(s));
7  
}
8  
9  
static S rpad(int l, S s) {
10  
  ret rpad(s, l);
11  
}

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: #1002634
Snippet name: rpad - pad (append empty characters)
Eternal ID of this version: #1002634/6
Text MD5: 49be1b498e5eacb3f1f3d11b2f7a6a7f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-03 12:11:14
Source code size: 218 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 744 / 747
Version history: 5 change(s)
Referenced in: [show references]