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

8
LINES

< > BotCompany Repo | #1002853 // autoUnindent

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

Libraryless. Click here for Pure Java version (2352L/15K).

static S autoUnindent(S s) {
  int n = getIndent(s);
  if (n == 0) ret s;
  L<S> l = toLines(s);
  for (int i = 0; i < l(l); i++)
    l.set(i, substring(l.get(i), n));
  ret fromLines(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: #1002853
Snippet name: autoUnindent
Eternal ID of this version: #1002853/1
Text MD5: eaea3774869e14ed4ee693a521dd7986
Transpilation MD5: f8f1cd3ae05c807b3b0c4731e6850ab9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-03 23:04:01
Source code size: 196 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 764 / 806
Referenced in: [show references]