Use this tag for questions related to trailing whitespace characters.
Trailing whitespace characters can be presented/rendered in a way that is not distinguishable from the actual end of the data. This can lead to issues if the data presented to the user differs meaningfully from the actual data.
- trailing whitespaces in folder names
- trailing whitespaces in string inputs
- handling of trailing whitespace: preservation vs. omission
- preservation of the correct whitespace as different whitespace characters may be displayed in the same way
While SPACE
and TAB
may be the most common whitespace characters, the Unicode Character Database (source) lists 25 different characters classified as "White_Space":
0009..000D ; White_Space # Cc [5] <control-0009>..<control-000D> 0020 ; White_Space # Zs SPACE 0085 ; White_Space # Cc <control-0085> 00A0 ; White_Space # Zs NO-BREAK SPACE 1680 ; White_Space # Zs OGHAM SPACE MARK 2000..200A ; White_Space # Zs [11] EN QUAD..HAIR SPACE 2028 ; White_Space # Zl LINE SEPARATOR 2029 ; White_Space # Zp PARAGRAPH SEPARATOR 202F ; White_Space # Zs NARROW NO-BREAK SPACE 205F ; White_Space # Zs MEDIUM MATHEMATICAL SPACE 3000 ; White_Space # Zs IDEOGRAPHIC SPACE