About Trim Each Line
Trim Each Line removes leading and trailing whitespace from every line in your input — spaces, tabs, and other whitespace characters at the start or end. The line count is preserved exactly: empty lines stay as empty lines (use Remove Blank Lines if you want them gone). Whitespace inside a line is left untouched.
Reach for this when copy-paste has left ragged edges. Pasting a column from a spreadsheet, an indented block from a config file, or text from a PDF often introduces stray spaces that break later equality comparisons. Trim normalises lines so that subsequent operations — Remove Duplicate Lines, Inner Join, Sort Lines — see semantically equal items as identical. The transform is idempotent: running it twice produces exactly the same output as running it once.
Examples
apple
banana
cherry apple
banana
cherryLeading and trailing whitespace stripped from each line. Line count is unchanged.
Frequently asked questions
Does it remove blank lines?
No. Lines that contain only whitespace become empty lines but are not deleted. Run Remove Blank Lines afterwards if you want them gone.
Does it touch whitespace inside a line?
No. `Hello World` (with three internal spaces) stays unchanged; only the leading and trailing whitespace is stripped.
Why run this before deduping or joining?
Because comparison operations treat `apple` and `apple ` (trailing space) as different items. Trimming first means the comparison sees the values you intend to compare.
What counts as whitespace?
Spaces, tabs, carriage returns, line feeds, vertical tabs, and form feeds — the same Unicode whitespace set as JavaScript's String.prototype.trim().
