collapseWhitespace
Collapses multiple whitespace characters into single spaces.
collapseWhitespace
Signature
typescript
function collapseWhitespace(str: string): stringParameters
str- The string to collapse whitespace in
Returns
String with collapsed whitespace.
Examples
typescript
import { collapseWhitespace } from 'strio'
collapseWhitespace('hello world')
// "hello world"
collapseWhitespace('test\n\n\nline')
// "test line"