In this video we'll learn how to do some string manipulation.
When to use
There are always times when you'll want to manipulate strings. Here's how to do it.
There are many ways to manipulate strings.
- .upper() = changes everything to uppercase
- .lower() = changes everything to lowercase
- .title() = changes the first letter of each word to uppercase
- .capitalize() = capitalizes just the first letter of the first word
- .swapcase() = reverses the case of every letter
To find the length of a string, wrap it in the len function:
Print a range of characters from a string:
Split apart your string by its spaces:
Hints & tips
- There are many ways to manipulate strings
Lesson notes are only available for subscribers.