我有一个看起来像这样的字符串:
<type 'str'>
Hi George,
Thanks for sending me your report.
Ill take a look at it and get back to you tomorrow.
Run Code Online (Sandbox Code Playgroud)
我想要做的是将其转换为一个字符串,如下所示:
Hi George, Thanks for sending me your report. Ill take a look at it and get back to you tomorrow.
Run Code Online (Sandbox Code Playgroud)
怎么想我怎么做?
用这个 :
>>> print(" ".join(input_str.split()))
'Hi George, Thanks for sending me your report. Ill take a look at it and get back to you tomorrow.'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
96 次 |
| 最近记录: |