可能重复: 在Python中用单个空格替换多个空格
如何在python中将多个空格压缩为1个空格?
例如,假设我有一个字符串
"some user entered text"
我希望那成为
python regex
python ×1
regex ×1