"""author: @pythonpips"""

s = '    Hello World'
s.strip() # Hello World

pp = 'PythonPips    '
pp.strip() # PythonPips
How to Remove Whitespace Start and End of a String in Python

Subscribe to our newsletter