我一直试图从字符串中删除\n加上单词前后的空格,但由于某些原因,它不起作用。你知道吗
这就是我所尝试的:
.strip(my_string)
以及
re.sub('\n', '', my string)
我尝试使用.strip
和re
来让它工作,但它只返回相同的字符串。你知道吗
\\n The people who steal our cards already know all of this...\\n
\\n , \\n I\'m sure every fraud minded person in America is taking notes.\\n
\\n
The people who steal our cards already know all of this..., I\'m sure every fraud minded person in America is taking notes.
你可能在找这样的东西:
用法示例如下:
如果您还想获取字符序列
r'\n'
,那么我们也来获取它们:以及输出:
相关问题 更多 >
编程相关推荐