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

3
LINES

< > BotCompany Repo | #1029731 // quoteOr - quote() when string is not empty, return custom default value otherwise

JavaX fragment (include)

sS quoteOr(S s, S whenEmpty) {
  ret empty(s) ? whenEmpty : quote(s);
}

Author comment

Began life as a copy of #1023084

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029731
Snippet name: quoteOr - quote() when string is not empty, return custom default value otherwise
Eternal ID of this version: #1029731/1
Text MD5: 30484805710bccafc3f664757441e371
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-09 13:34:51
Source code size: 73 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 100 / 134
Referenced in: [show references]