Python String lstrip() Method
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.
chars (optional) : A list of chars
It returns a string.
Let's see some examples of lstrip() method to understand it's functionality
Python String lstrip() Method Example 1
A simple program to understand use of lstrip method. See how it removes leading spaces.
Python String lstrip() Method Example 2
Here, we are adding some special chars to the string and applying lstrip to remove leading chars.
Python String lstrip() Method Example 3
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week