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)

// usually L<S>
static String fromLines(Iterable lines) {
  new StringBuilder buf;
  if (lines != null)
    for (O line : lines)
      buf.append(str(line)).append('\n');
  return buf.toString();
}

static String fromLines(S... lines) {
  ret fromLines(asList(lines));
}

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: 731 / 3241
Version history: 3 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1002661 - joinLines - extends fromLines
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1007439 - lines - short for fromLines / toLines
#1017949 - rtrim_fromLines - no \n after last line
#3000382 - Answer for ferdie (>> t = 1, f = 0)