From the course: Advanced Python
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
String manipulation - Python Tutorial
From the course: Advanced Python
String manipulation
- [Instructor] Other programming languages make developers do a lot of the heavy lifting when it comes to manipulating string content, but Python provides a lot of great built-in features for this. In this example, we'll see how to perform some common string manipulation operations. So here in my test code, I have defined a test string that we can use to operate on, and feel free to make your own variations of it if you want to try out your own experiments. So first, we could easily convert a string to upper or lowercase, or what's called title case, where each word is capitalized, by using the corresponding Python function. So let's try out some of these. So first, let's try out upper, and also we'll try out lower, and let's try out title as well. Alright, so let's go ahead and run this. And here in the terminal, you can see the results. So here's the result of upper, where all the characters are uppercase. This is the result of lower, and then title case is where each word gets…