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

8
LINES

< > BotCompany Repo | #1002853 - autoUnindent

JavaX fragment (include)

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   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1002853
Snippet name: autoUnindent
Eternal ID of this version: #1002853/1
Text MD5: eaea3774869e14ed4ee693a521dd7986
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: 359 / 332
Referenced in: [show references]

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