Trim Lines

Local tool Remove leading and trailing whitespace from each line or delete empty lines.

Good to know

Trimming and deleting blank lines are separate operations. A line containing only spaces becomes empty after trimming.

FAQ

Are spaces inside a line removed?

Trimming affects the two ends of each line. Spaces between words are preserved.

Can I preserve indentation?

Use only the empty-line operation. Trimming removes leading whitespace from nonempty lines as well.