PythonStringlstrip
strip

lstripString

rstrip

Removes leading whitespace (or specified characters).

Syntax

str.lstrip(chars?)

Example

Enter values below to update the example in real time.

print
lstrip
text = "  hello world  "
print(text.lstrip())  # "hello world  "