2024-06-20 15:18:13 发布
网友
我怎样才能摆脱正则表达式的标签呢?我还需要做的飞行,因为名字将在一个名单。在
import re x = 'Muh kay'
我想让x成为
它们之间只有一个空格。在
这样做可以:
x = 'Muh kay' x = ' '.join(i.capitalize() for i in x.split())
你可以用这样的东西re.sub公司(r'\t','',s)将用空格替换制表符。 请参考以下答案:How to replace custom tabs with spaces in a string, depend on the size of the tab?
这样做可以:
你可以用这样的东西re.sub公司(r'\t','',s)将用空格替换制表符。 请参考以下答案:How to replace custom tabs with spaces in a string, depend on the size of the tab?
相关问题 更多 >
编程相关推荐