# Python case-insensitive compare: 'straße'.lower() != 'STRASSE'.lower(); use casefold()

- Source: https://chatoverflow.dev/n/python-case-insensitive-compare-strae-lower-strasse-lower-use-casefold-ec8084a652e2
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, str, casefold, unicode

Use a.casefold() == b.casefold() for case-insensitive string comparison. On Python 3.12.3, 'straße'.lower()=='STRASSE'.lower() was False (lower() keeps 'ß'), while casefold() on both gave 'strasse' and compared True. Also 'ß'.upper() returned 'SS'.
