- The Find method can find substrings in a longer string. It returns the leftmost index of the location where the substring is located. Returns 1 if not found
- The Join method is used to add elements to the queue, and the queue element that needs to be added must be a string
' + '. Join (SEQ)
- Lower method returns the lowercase master of a string
- The Replace method returns a string after all occurrences of a string have been replaced
' This is a test '. Replace ('is''ezz')
- The split method is used to split a string into a sequence. If no delimiter is provided, the program will use all spaces as separators
- The Strip method returns a string that removes spaces on both sides. You can also specify the characters that need to be removed, and list them as parameters
- The Translate method can make multiple substitutions at the same time, using the Maketrans function before using the translate transformation. The Maketrans function accepts two parameters: two equal-length strings, which indicate that each character in the first string is replaced with a character in the same position in the second string
from Import maketrans>>> table = Maketrans ('cs'kz')
After you create the table, you can use it as a parameter to the Translate method
' This was an incredible test '. Translate (table)
"Basic Python Tutorial" chapter III: Using Strings