Formatting
Indents from a PDF, a code block, or a copied table sit at the ends of lines and break equality checks. Trim walks each line and removes ordinary spaces and tabs from both ends. The middle of the line is untouched. “ Odd socks ” and “ in the dryer. ” become “Odd socks” and “in the dryer.”
A line that was only spaces becomes an empty line and stays in the list. Trim does not delete it. Remove empty lines does. A double space between words stays a double space. Collapse spaces is the operation that shrinks that run. A Windows carriage return is treated as a line break, so the padding before it is still trimmed.
“Odd socks in the dryer.” has no padding, so the result is the same sentence, period included. Trim uses Unicode whitespace, so a non-breaking space or an em space at either end goes too. A zero-width space is not whitespace and can sit there after the line looks clean. Collapse spaces is stricter in the other direction: it only shrinks ordinary spaces and tabs, and it leaves a non-breaking space in the middle of a line.
A line “ Odd socks ” and a line “ in the dryer. ”, including the spaces at both ends.
Odd socks in the dryer. Interior spaces were already single, so they look the same. Only the ends changed.
Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.
No. Trim only removes the ends. “Odd socks” stays “Odd socks”. Collapse spaces does the interior.
It becomes an empty line and remains. It is not deleted on this page.
Yes. Trim removes Unicode whitespace, including non-breaking spaces and em spaces. A zero-width space is not whitespace and stays. Collapse spaces, by contrast, only shrinks ordinary spaces and tabs.
“Odd socks in the dryer.” has nothing at either end to remove. The period is not whitespace.
No. A tab between words stays. Only tabs that sit at the start or end of a line are stripped.