The method lstrip() returns a copy of the string in which all chars have been stripped from the beginning of the string (default whitespace characters).
The syntax of the method is: str.rstrip([chars])
Below is the python program to demonstrate the lstrip() function:
str = "The Best Learning Resource for Online Education"; print (str.lstrip()) str = "****The Best Learning Resource for Online Education****"; print (str.lstrip('*'))
When we run above the program, the outcome is as follows:
The Best Learning Resource for Online Education
The Best Learning Resource for Online Education****
Below are several other functions that we can use to work with string in Python 3