Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries

The Python String lstrip() method is used to trim the string from left side only. This method has one optional parameter which is used to specify trim character(s). Default value of this parameter is whitespace.




character(s) Optional. Character(s) which need to be trimmed from left side of the string. default value is whitespace.

Return Value

Returns the string which is left side trimmed version of the given string.


In the below example, lstrip() method is used to trim the specified characters from the left side of the string.

MyString = "   Hello World!   "

MyString = "@*Hello, World*@"

The output of the above code will be:

Hello World!  
Hello, World*@

❮ Python String Methods