lstrip()
Python String lstrip() Method
Last Updated : 31 Dec 2025
Python lstrip() method is used to remove all leading characters from the string. It takes a char type parameter which is optional. If parameter is not provided, it removes all the leading spaces from the string.
Syntax of Python String Istrip() Method
It has the following syntax:
Parameters
chars (optional): A list of chars.
Return
It returns a string.
Different Examples for Python String lstrip() Method
Let's see some examples of lstrip() method to understand it's functionality
Example 1
A simple program to understand use of lstrip method. See how it removes leading spaces.
Output:
Example 2
Here, we are adding some special chars to the string and applying lstrip to remove leading chars.
Output:
$$$$-Javatpoint-$$$$ -Javatpoint-$$$$
Example 3
Let us take an example to demonstrate the Python String Istrip() Function.
Output:
http://www.javatpoint.com javatpoint.com