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
|
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