Site icon i2tutorials

lstrip() method in Python String Module

lstrip() method in Python String Module


lstrip methodin string module returns the output by removing any spaces available in the left side of the string.


Syntax:

Str.lstrip()


Example-1:

text = "      Mango  "
x = text.lstrip()
print("of all fruits", x, "is the King")


Output :

Exit mobile version