Jam*_*mes 3 python regex
可能重复: 在Python中用单个空格替换多个空格
试图弄清楚如何编写给定字符串的正则表达式:
"hi this is a test"
我可以把它变成
将空格规范化为一个空格
有任何想法吗?非常感谢
Ste*_*edy 7
import re re.sub("\s+"," ",string)
归档时间:
15 年,9 月 前
查看次数:
2907 次
最近记录: