Text editing guides

Remove line padding without changing mixed endings

·

Text copied from a field log may have an extra margin on every line. Use one-sided trim when the padding at the other end carries information for a downstream tool.

Text Trimmer

Remove five leading spaces and tabs from the sample

Select Load example, then choose Trim the start. The tool reports three lines changed and five whitespace characters removed. Look for café, غرب and next at the start of their respective lines.

Move the cursor to the end of the first line and back two characters. The two spaces after café are still present. Switch to Trim the end to remove those spaces while bringing back the indentation.

Inspect the three different line endings in the download

The café line ends in CRLF, the Arabic line ends in CR, and the next line ends in LF. Select Download TXT with Trim the start selected and open the file in an editor that can show line-ending markers.

A textarea can display the three endings identically. For a file with mixed endings, upload the original file and avoid typing into the input before downloading. If you want a single type of ending, send the trimmed file through Line Ending Converter.

Unicode 17.0 — White_Space property list

Collapse an interior gap on a separate copy

Type café, followed by two ordinary spaces, then type map. Trim both ends keeps the gap. Trim and collapse internal spaces changes the gap to one space and increases the removal count by one.

Unicode 17.0 — White_Space property list

Common questions

Which whitespace characters can be trimmed at an edge?

Ordinary spaces, tabs, nonbreaking spaces and other Unicode White_Space characters are trimmed at a line edge. Line separators are kept.

Can I remove whitespace-only lines?

This tool preserves their line separators and trims the contents according to the selected mode. Remove Empty Lines removes the line itself.

Sources

Put it into practice.

Related guides