Python String lstrip() MethodPython 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. SignatureParameterschars (optional) : A list of chars ReturnIt returns a string. Let's see some examples of lstrip() method to understand it's functionality Python String lstrip() Method Example 1A simple program to understand use of lstrip method. See how it removes leading spaces. Output: Javatpoint Javatpoint Python String lstrip() Method Example 2Here, we are adding some special chars to the string and applying lstrip to remove leading chars. Output: $$$$-Javatpoint-$$$$ -Javatpoint-$$$$ Python String lstrip() Method Example 3Output: http://www.javatpoint.com javatpoint.com Next TopicPython Strings |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India