Skip to content

Instantly share code, notes, and snippets.

@omas-public
Created July 15, 2026 02:27
Show Gist options
  • Select an option

  • Save omas-public/b7aa4603b8a79c0cfcefa67e6a6fcd2f to your computer and use it in GitHub Desktop.

Select an option

Save omas-public/b7aa4603b8a79c0cfcefa67e6a6fcd2f to your computer and use it in GitHub Desktop.

Python String Functions

split Methods

  • split(sep=None, maxsplit=-1)
  • rsplit(sep=None, maxsplit=-1)

replace Methods

  • replace(old, new, count=-1)
  • removelprefix(prefix, /)
  • removesuffix(suffix, /)

find Methods

  • find(sub[, start[, end]])
  • rfind(sub[, start[, end]])
  • index(sub[, start[, end]])
  • rindex(sub[, start[, end]])
  • startswith(suffix[, start[, end]])
  • endswith(suffix[, start[, end]])
  • casefold()

convert Methods

  • upper()
  • lower()
  • capitalize()
  • strip([chars])
  • lstrip([chars])
  • rstrip([chars])
  • zfill(width)

count Methods

  • count(sub[, start[, end]])

is Methods

  • isalnum()
  • isalpha()
  • isascii()
  • isdecimal()
  • isdigit()
  • isnumeric()
  • isupper()
  • islower()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment