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

12
LINES

< > BotCompany Repo | #1002398 // fromLines (function) - appends \n after last line too

JavaX fragment (include)

1  
// usually L<S>
2  
static String fromLines(Iterable lines) {
3  
  new StringBuilder buf;
4  
  if (lines != null)
5  
    for (O line : lines)
6  
      buf.append(str(line)).append('\n');
7  
  return buf.toString();
8  
}
9  
10  
static String fromLines(S... lines) {
11  
  ret fromLines(asList(lines));
12  
}

Author comment

Began life as a copy of #2000329

download  show line numbers  debug dex  old transpilations   

Travelled to 18 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lnbujpyubztb, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, podlckwnjdmb, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1002398
Snippet name: fromLines (function) - appends \n after last line too
Eternal ID of this version: #1002398/4
Text MD5: 2a4c4b92f71ddf6b061957dec10c5f76
Author: stefan
Category: javac
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-11 13:58:43
Source code size: 281 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 725 / 3234
Version history: 3 change(s)
Referenced in: [show references]