String Methods

What is a string method?

A string method is a function that performs an action on a string. String methods are useful for presenting data in a certain format or cleaning up user-submitted data.

How do you change the case of a string?

To change the case of a string, use the methods title(), upper(), and lower().

How do you strip whitespace from a string?

The lstrip(), rstrip(), and strip() methods remove extra whitespace from strings, helpful for cleaning up data.