Skip to content

Handy string tools

Read · 1 of 3

A few tools you'll use constantly

s.upper() and s.lower() change case. s.split() cuts text into words, and " ".join(words) glues them back with spaces.

Every character has a number: ord("a") is 97 and chr(98) is "b". Digits work too: int("7") is 7.