Python reference

Python string methods

Clean, split, search and reformat text: split, join, strip, replace, find, upper and more.

String methods work on text. You call them with a dot after a string (name.upper()). Strings never change in place, so every method gives you back a new string (or a list, a number or True/False) and leaves the original as it was.

Most used

All 33 string methods

Spotted a mistake on this page? Tell us