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

15
LINES

< > BotCompany Repo | #1003144 // indentx function - handles trailing \n better

JavaX fragment (include)

sS indentx(O s) {
  ret indentx(strOrEmpty(s));
}

static S indentx(S s) {
  return indentx(indent_default, s);
}

static S indentx(int n, S s) {
  return dropSuffix(repeat(' ', n), indent(n, s));
}

static S indentx(S indent, S s) {
  return dropSuffix(indent, indent(indent, s));
}

Author comment

Began life as a copy of #1000672

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1003144
Snippet name: indentx function - handles trailing \n better
Eternal ID of this version: #1003144/2
Text MD5: 84ca3974c615fdca898bffe5e3f508c9
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-05 20:10:00
Source code size: 297 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 743 / 1159
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)