Python Modify Strings
Last Update : 12 Feb, 2023In this tutorial, you will learn to modify strings in Python.
Modifying strings in Python is used to changes to an existing string, such as concatenating strings, replacing substrings, slicing parts of the string, splitting the string into substrings, changing the case of the string, etc.
There are many string methods and operators available to modify strings in Python.
Example usage of modifying Python strings is as follows.
- Join two strings using the + operator.
- Replace a substring using the replace() method.
- Extract a part of the string using slicing.
- Split the string into substrings using the split() method.
- Change the case of the string using the upper() and lower() methods.