withAlternative

Checks if a string is empty, and returns an alternative

pure nothrow @safe
string
withAlternative
(
string str
,
string alt
)

Parameters

str string

The target string

alt string

The alternate string

Return Value

Type: string

alt if the string is empty, else it returns the string

Meta