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

24
LINES

< > BotCompany Repo | #1000672 // indent function

JavaX fragment (include)

static int indent_default = 2;

static String indent(int indent) {
  return repeat(' ', indent);
}

static String indent(int indent, String s) {
  return indent(repeat(' ', indent), s);
}

static String indent(String indent, String s) {
  return indent + replace(unnull(s), "\n", "\n" + indent);
}

static String indent(String s) {
  return indent(indent_default, s);
}

static L<S> indent(S indent, L<S> lines) {
  new L<S> l;
  if (lines != null) for (S s : lines)
    l.add(indent + s);
  ret l;
}

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: #1000672
Snippet name: indent function
Eternal ID of this version: #1000672/4
Text MD5: 6a6c13b9fb688c44e6eda8c075a5c521
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-11-01 23:11:23
Source code size: 523 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 783 / 1738
Version history: 3 change(s)
Referenced in: [show references]