Python String lstrip() Method
Removes the specified leading characters from the start of a string.
Syntax
Python
Copy Code
string.ljust(length, character = " ")
Parameters
Parameter | Description |
---|---|
character |
Optional. The set of characters to strip from the beginning of the string. Default is a space (" ") |
Example
Python
Copy Code
print('Hello World!'.lstrip('Hello '))
Output
World!