remove spaces fromstring code example
Example 1: delete spaces in string python
>>> s.replace(" ", "")
Example 2: python remove spaces from string
>>> " ".join(s.split())
'Hello World From Pankaj Hi There'
>>> s.replace(" ", "")
>>> " ".join(s.split())
'Hello World From Pankaj Hi There'