17 lines
616 B
Plaintext
17 lines
616 B
Plaintext
:sig
|
|
String first(String... args)
|
|
|
|
:params
|
|
args : a variable number of String arguments
|
|
return value : first of the 'args' that was not empty.
|
|
|
|
:desc
|
|
Given a variable number of String parameters, the first() function returns the first of these parameters that was not empty. Leading and trailing whitespace characters are not considered, resulting in a string that contains only whitespace characters being considered empty.
|
|
|
|
:see
|
|
>string
|
|
|
|
:related
|
|
**PHP:** Null-coalescing patterns like `$a ?? $b`, fallback helpers, or `reset()` for arrays
|
|
**JavaScript / Node.js:** `??`, `||`, and small fallback helper functions
|