Find out what each of the expressions does to the string in the center.
Every string in Python brings a list of functions to work with it. As the functions are contained within the string they are also called methods. They are used by adding the .
to the string variable followed by the method name.
Below you find a few of the available methods:
s = 'Manipulating Strings '
s.upper()
s.lower()
s.strip()
s.split(' ')
s.find('ing')
The method returns the start index of the match. The result -1 means that no match has been found.
s.replace('Strings','text')
s.startswith('Man')
s.endswith('ings')