1. Help Center
  2. Python Programming

How would you remove all leading whitespace in a string?

Python provides the inbuilt function lstrip() to remove all leading spaces from a string.
 
>>“ Python”.lstrip

 

Output: Python