Trim Line Spaces
Strip leading and trailing spaces and tabs from every line so the text lines up on the left. Good for cleaning content copied from tables, code, or web pages; spaces inside a line are preserved.
How to use
- Each line is processed separately; only whitespace at the start and end is removed, and the text itself is not changed.
- Combining it with deduplication or sorting afterwards usually gives more predictable results.
FAQ
Are spaces inside a line removed too?
No. Only whitespace at the beginning and end of each line is touched. Ordinary spaces between words stay, so English words will not be glued together.
Why is there still indentation after trimming?
Full-width spaces or other invisible characters may not be recognised as ordinary whitespace. Try removing those characters with a replace function first, then run the trim again.
Further reading