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

9
LINES

< > BotCompany Repo | #1009103 - pad - pad (move contents to the right)

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

Libraryless. Click here for Pure Java version (83L/1K).

1  
static S pad(O s, int l) {
2  
  ret pad(s, l, ' ');
3  
}
4  
5  
static S pad(O s, int l, char c) {
6  
  S _s = str(s);
7  
  if (lengthOfString(_s) >= l) ret _s;
8  
  ret rep(c, l-lengthOfString(_s)) + _s;
9  
}

Author comment

Began life as a copy of #1002634

download  show line numbers  debug dex   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz, whxojlpjdney

No comments. add comment

Snippet ID: #1009103
Snippet name: pad - pad (move contents to the right)
Eternal ID of this version: #1009103/5
Text MD5: 554d545051757832f00e87bcd462938e
Transpilation MD5: 4142b00078612d0eab25b1d09e00a094
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-26 13:31:40
Source code size: 193 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 313 / 359
Version history: 4 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1009103 & http://1009103.tinybrain.de