Whitespace Reference

Whitespace is not one interchangeable character. Its meaning depends on the format, the position in a line, and the program that reads the text.

Common characters

Invisible characters can be revealed in an editor's whitespace display or inspected with code-point-aware tools. Visual similarity alone is not proof that two strings are equal.

What JavaScript trim means here

JavaScript String.trim() removes whitespace recognized by the language from both ends of a string. TinyDevTools applies it to each line in Trim Whitespace. It does not collapse internal spaces or tabs and does not offer an ASCII-only mode.

Blank-line test versus trimming output

Remove Empty Lines uses trim() only to test whether a line is empty. It keeps every non-empty line exactly as entered, including its indentation and trailing spaces. Trim Whitespace changes the output of every line by removing outer whitespace. Use the operation that matches the intended change.

Exact duplicate comparison

Find Duplicate Lines and Remove Duplicate Lines compare complete line strings exactly. Case, punctuation, leading whitespace, and trailing whitespace all participate. Normalize first only when the system consuming the result treats those differences as equivalent.

Formatting can be syntax

Indentation can define blocks in Python and YAML; tabs can be significant in Makefiles; and spaces inside quoted fields or values can be data. Inspect the format and downstream parser before cleaning. See the guide to whitespace in text and code for a cautious workflow.

Tool details: Trim Whitespace, Remove Empty Lines, and Find Duplicate Lines.

Advertisements