Python String Methods

Beginner
6 min read
Updated: Nov 2026
15 method guides
Method index

About This Index

This page is the Python String Methods index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.

Learn what a string is on /python/string. Use this page when you need a specific API such as capitalize(), find(), or format().

Beginner path.

Start with capitalize(), find(), format(), and isdigit()—then browse the rest by category.

How to Call a String Method

Call methods with dot notation on a str value:

Python
text = "Hello, Python!"

print(text.capitalize())
print(text.find("Python"))
print(text.endswith("!"))
print("Count: {}".format(3))

Python String Methods Table

All method guides in this Python tutorial series (15 tutorials).

Case & formatting

3 methods

Change letter case and align text inside a width.

MethodDescriptionTutorial
capitalize()First character upper, rest lower.Try it
casefold()Aggressive lowercase for comparisons.Try it
center()Center text within a width.Try it

Search & check

4 methods

Locate substrings, count matches, and test suffixes.

MethodDescriptionTutorial
find()Index of substring, or -1.Try it
index()Index of substring, or ValueError.Try it
count()Count how many times sub appears.Try it
endswith()True if string ends with suffix.Try it

Tabs & whitespace helpers

1 method

Expand tabs into spaces (more split/join methods coming in this series).

MethodDescriptionTutorial
expandtabs()Replace tabs with spaces.Try it

Validation

4 methods

Return True or False to validate character content.

MethodDescriptionTutorial
isalnum()Letters and digits only.Try it
isalpha()Letters only.Try it
isdecimal()Strict decimal digits.Try it
isdigit()Digit characters only.Try it

Encoding & templates

3 methods

Build formatted messages and convert text to bytes.

MethodDescriptionTutorial
encode()Encode str to bytes.Try it
format()Fill {placeholders} with values.Try it
format_map()Format from a dictionary.Try it

Frequently Asked Questions

String methods are built-in operations on str objects. You call them with dot notation: text.upper(), text.find("hello"). They format, search, validate, and transform text.
The Strings page teaches what a string is—quotes, f-strings, len(), and immutability. This Methods index lists every method tutorial so you can open capitalize(), find(), format(), and the rest.
No. Strings are immutable. Methods return a new string (or bool/int for checks). Assign the result if you need to keep it.
Both locate a substring. find() returns -1 when missing; index() raises ValueError. Use find() when absence is normal.
If you are new, read Python Strings first. Then open capitalize(), find(), format(), and isdigit() from the table below.

Start with capitalize()

Open the first case method—syntax, examples, and FAQs.

capitalize() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

15 people found this page helpful