Trim Lines
Trim leading and trailing whitespace from every line while preserving the line structure.
How to use
- Enter multiline text and run the cleanup.
Capabilities and scope
This is per-line String.trim rather than a single trim of the whole document.
How it works
The line array is transformed with line.trim() and joined again with newlines.
Example
' a b' becomes 'a b'.
Useful for
- Clean copied lists with unwanted edge whitespace
Before you use it
- Internal repeated spaces and blank lines themselves are not removed.
Frequently asked questions
Does it collapse spaces inside a line?
No. Only the beginning and end of each line are trimmed.