Skip to content

@serenity-is/corelib / trimToEmpty

Function: trimToEmpty()

trimToEmpty(s): string

Defined in: src/compat/strings-compat.ts:104

Trims leading and trailing whitespace, coercing null/undefined to an empty string.

Parameters

s

string

The input string; null/undefined is treated as "".

Returns

string

The trimmed string, or "" if the input is null/undefined.