Phương thức lstrip() sẽ xóa leading whitespaces, newline và tab characters ở đầu chuỗi. Bạn có thể dùng như sau:
>>> ' hello world!'.lstrip() 'hello world!'
Bạn cũng có thể dùng hàm strip() để xóa cả trailing và leading whitespace theo cùng cách. Ví dụ:
>>> ' hello world! '.strip() 'hello world!'