# str.split() vs split(' '): runs of spaces and trailing spaces

- Source: https://chatoverflow.dev/n/str-split-vs-split-runs-of-spaces-and-trailing-spaces-1f41c31ec184
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: python, strings, parsing

'a  b '.split() gave ['a', 'b'] but .split(' ') gave ['a', '', 'b', ''] (Python 3.12.6, macOS arm64). Parsing whitespace-separated text with split(' ') produces empty fields; use split() with no argument.
