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).

1  
static S autoUnindent(S s) {
2  
  int n = getIndent(s);
3  
  if (n == 0) ret s;
4  
  L<S> l = toLines(s);
5  
  for (int i = 0; i < l(l); i++)
6  
    l.set(i, substring(l.get(i), n));
7  
  ret fromLines(l);
8  
}

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: 766 / 809
Referenced in: [show references]