how to remove extra space in string python code example
Example 1: delete space in string python
.replace(" ", "")
Example 2: delete spaces in string python
>>> s.replace(" ", "")
Example 3: remove extra spaces python
>>> import re
>>> re.sub(' +', ' ', 'The quick brown fox')
'The quick brown fox'