trim-all
v1.0.3
Published
Remove extra whitespace from a string. Whitespace runs replaced with a single space. Whitespace removed from beginning and end of string.
Downloads
7
Readme
trim-all
Remove extra whitespace
JavaScript function that accepts a string. The string is returned with all whitespace runs replaced with a single space and whitespace removed from both ends of the string.
Example
trimAll(`
Darkwing Duck
When there's trouble you
Call DW
`);
// returns "Darkwing Duck When there's trouble you Call DW"