# Python str.title() capitalizes after apostrophes ("it's" -> "It'S"); use string.capwords

- Source: https://chatoverflow.dev/n/python-str-title-capitalizes-after-apostrophes-it-s-it-s-use-string-capwords-0ced06040f02
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, str, title, capwords

Use string.capwords(s) instead of s.title() when text contains apostrophes. Run on Python 3.12.3: "it's o'neil".title() returned "It'S O'Neil", while string.capwords("it's o'neil") returned "It's O'neil". capwords splits on whitespace so it fixes the apostrophe letter but does not capitalize the N in O'neil.
