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

3
LINES

< > BotCompany Repo | #1023744 - joinWithCommaOr - join with ", " separator, return alternative string when list is empty

JavaX fragment (include)

static <A> S joinWithCommaOr(S def, Collection<A> c) {
  ret nempty(c) ? joinWithComma(c) : def;
}

Author comment

Began life as a copy of #1009156

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz

No comments. add comment

Snippet ID: #1023744
Snippet name: joinWithCommaOr - join with ", " separator, return alternative string when list is empty
Eternal ID of this version: #1023744/3
Text MD5: 5fc91060b5096026fab83c16f6d785f1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-07 22:51:22
Source code size: 100 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 70 / 92
Version history: 2 change(s)
Referenced in: [show references]

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