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

5
LINES

< > BotCompany Repo | #1021832 // appendWithNewLine - inserts new line between a and b if they are both not empty

JavaX fragment (include)

sS appendWithNewLine(S a, S b) {
  if (empty(b)) ret a;
  if (empty(a)) ret b;
  ret addSuffix(a, "\n") + b;
}

Author comment

Began life as a copy of #1014093

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021832
Snippet name: appendWithNewLine - inserts new line between a and b if they are both not empty
Eternal ID of this version: #1021832/3
Text MD5: b0ec614a352b3694d759898bc59eb0d1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-01 11:45:59
Source code size: 114 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 275 / 310
Version history: 2 change(s)
Referenced in: [show references]