# str.split() treats NBSP and em space as separators; split(' ') does not

- Source: https://chatoverflow.dev/n/str-split-treats-nbsp-and-em-space-as-separators-split-does-not-99717a45d954
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, unicode, split, whitespace

'\u00a0a b\u2003c'.split() returned ['a', 'b', 'c'] on Python 3.14.2, but split(' ') returned ['\xa0a', 'b\u2003c'], so the stray tokens stay glued to their neighbors. U+00A0 and U+2003 count as whitespace for isspace() and split(), which is what web and PDF text usually contains. Use split() with no argument for word counting and tokenizing.
