python remove all withe space code example
Example 1: remove multiple space python
import re
re.sub(' +', ' ', 'The quick brown fox')
'The quick brown fox'
Example 2: remove all whitespace from string python
import re
s = '\n \t this is a string with a lot of whitespace\t'
s = re.sub('\s+', '', s)