Python - String Method - strip() Tutorial
It will remove any character from starting(left end) and ending(right end) part of the string. by default, it will remove space. To remove other characters we need to define them in a parameter of the strip() method.
String.strip(character)
#character - A set of multiple character that need to
be removed from beginning and ending of a String
Example-
str1 = " Hello Welcome to python Tutorial "
print(str1.strip())
str2 = ",,,].rrHello Pythonggg,,,;;;"
print(str2.strip(",.rg;]"))
Output-
Hello Welcome to python Tutorial
Hello Python