Python_String_Methods_CheatSheet (1)
Python_String_Methods_CheatSheet (1)
index() Like find(), but raises error if not found "hello".index("l") -> 2
rindex() Like rfind(), but raises error if not found "hello".rindex("l") -> 3
isdigit() Returns True if all characters are digits "123".isdigit() -> True
istitle() Returns True if string is in title case "Hello World".istitle() -> True
zfill() Pads string on the left with zeros "42".zfill(5) -> "00042"