@technobuddha > library > String > Operations
Function: collapseWhitespace()
ts
function collapseWhitespace(input: string, trim: CollapseWhitespaceOptions): string;Defined in: collapse-whitespace.ts:21
Replace all whitespace within a string with a single space
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | The string |
trim | CollapseWhitespaceOptions | If true, remove leading and trailing whitespace |
Returns
string