20 lines
542 B
Plaintext
20 lines
542 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.
|
|
|
|
:see
|
|
>string
|
|
|
|
:content
|
|
Returns the first non-empty string from the provided arguments.
|
|
|
|
Leading and trailing whitespace are ignored when checking emptiness, so a string containing only whitespace counts as empty.
|
|
|
|
## Related Concepts
|
|
|
|
- PHP: null-coalescing patterns like `$a ?? $b`, fallback helpers, or `reset()` for arrays
|
|
- JavaScript / Node.js: `??`, `||`, and small fallback helper functions
|