JavaScript String.trim() Online
Trim whitespace from both ends, with an optional custom character set.
Run details
The output updates as you type. The tool processes input in your browser.
Worked example
A custom trim set removes the listed characters from the boundaries while preserving them inside the string.
- Chars to trim (optional)
""
manuals plus
manuals plus
Using this operation in JavaScript
The interactive result uses JavaScript. JavaScript string indexes count UTF-16 code units. Use code-point iteration when working with supplementary Unicode characters.