Skip to content

@serenity-is/corelib / toSingleLine

Function: toSingleLine()

toSingleLine(str): string

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

Collapses a string to a single line by replacing CR/LF and LF with spaces and trimming the result.

Parameters

str

string

The input string; null/undefined is treated as an empty string.

Returns

string

The single-line, trimmed string.