1. String Methods
What are String Methods?
There are multiple functions you can apply to strings. In this lesson, we will go over them and explain them to you. You can refer back to this page if you forget any of these!
How do you use String Methods?
To use string methods, all you have to do is call the string, add a dot after that and call the name of the function you would like to use.
z = "Hello"
In the example above, we referred back to the name of the variable and applied the string method on the variable.
However, you can also apply methods directly to a string as well!
All String Methods
Here is a list of all the string methods found in python. Refer back to this anytime you need to!
Converts the first character to uppercase.
Returns a centered string.
Returns an encoded version of the string.
Sets the tab size of the string.
Converts the string into lowercase.
Returns the number of times a specified value occurs in a string.
Returns true if the string ends with the specified value.
Searches a string for a specified value and returns the position where it was found.
Formats specified values in a string.