Remove Spaces
Remove every JavaScript whitespace character matched by \s.
How to use
- Enter the text and run the whitespace removal.
Capabilities and scope
Spaces, tabs, newlines, and other characters covered by the regular-expression whitespace class are deleted entirely.
How it works
The operation is input.replace(/\s/g,"").
Example
a b c d becomes abcd.
Useful for
- Create whitespace-free tokens or comparison strings
Before you use it
- All word and line boundaries disappear, so this is not intended to preserve prose readability.
Frequently asked questions
Are line breaks removed too?
Yes. Newlines and tabs are included in the whitespace class and are removed.