Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Remove Leading Whitespace From A Python String With .lstrip()

Calling [TODO: Code shorthand span ] on a python string trims any leading whitespace (including newlines), while leaving any trailing whitespace untouched. For example :

python
original = """

   hotel india juliett

    """

left_stripped = original.lstrip()

print(f"START|{left_stripped}|END")
results start