Function Details: lstrip

Description


Return a copy of the string with leading characters removed.


Extended Description


The lstrip() method returns a copy of the string with leading characters removed. If the chars argument is not provided, it removes leading whitespace characters (spaces, tabs, newlines, etc.). If chars is provided, it removes any leading characters that are in the chars string.


Read More about lstrip from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Parameter List


  • chars: str

Return


Returns a new string with specified leading characters removed.


Return Type


str

Output

Explanation

This example demonstrates the basic usage of lstrip(). It removes leading whitespace characters.