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

7
LINES

< > BotCompany Repo | #1032136 // or2_calc function - return string or calculatee default value if string is empty (=null or "")

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3077L/17K).

sS or2_calc(S a, IF0<?> b) {
  ret nempty(a) ? a : strOrNull(b?!);
}

sS lambda0Like or2_calc(IF0<?> b, S a) {
  ret or2_calc(a, b);
}

Author comment

Began life as a copy of #1003008

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032136
Snippet name: or2_calc function - return string or calculatee default value if string is empty (=null or "")
Eternal ID of this version: #1032136/3
Text MD5: 34494d9043859949140ed5b308344149
Transpilation MD5: e063bc8e530b97d7d6248f92691caf89
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-14 08:16:50
Source code size: 140 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 153 / 217
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1032937 - or_calc function