python remove consecutive spaces

Solutions on MaxInterview for python remove consecutive spaces by the best coders in the world

showing results for - "python remove consecutive spaces"
Fabio
09 Jan 2019
1# credit to the Stack Overflow user in the source link
2
3import re
4re.sub(' +', ' ', 'The     quick brown    fox')
5>>> 'The quick brown fox'
similar questions
queries leading to this page
python remove consecutive spaces