Skip to content

@technobuddha > library > String > Operations

Function: singleLine()

ts
function singleLine(template: TemplateStringsArray, ...args: unknown[]): string;

Defined in: single-line.ts:13

Joins a template literal into a single line string by removing line breaks and leading whitespace, then interleaving the provided arguments. The result is a trimmed, single-line string.

Parameters

ParameterTypeDescription
templateTemplateStringsArrayThe template strings array from a tagged template literal.
...argsunknown[]The values to be interpolated into the template.

Returns

string

A single-line string with all line breaks and leading whitespace removed.