Common String Methods [Python]

A useful summary of string methods ✂️

Subscribe to my newsletter and never miss my upcoming articles

course = "Python Programming"
course.upper()  # Returns a string uppercase
course.lower()  # Converts a string to lowercase
course.title()  # Returns a string with the first character 
# in uppercase
course.strip()  # Removes white spaces from both the 
# beginning and end of the string
course.rstrip()  # Removes white space from the end of the string
course.find("pro")  # Finds the index of a character or a 
# group of characters, but remember that Python is case-sensitive.
course.replace("p", "j")  # Replace a character
print("pro" in course)  # Returns a boolean result, not the index. 
print("shift" not in course)  # Returns a boolean result