u'The disclosure relates to systems and methods for detecting features on\n billets of laminated veneer lumber (LVL). In some embodiments, an LVL\n billet is provided and passed through a scanning assembly. The scanning\n assembly includes anx-raygenerator and anx-raydetector. Thex-raygenerator generates a beam ofx-rayradiation and thex-raydetector\n measures intensity of the beam ofx-rayradiation after is passes through\n the LVL billet. The measured intensity is then processed to create an\n image. Images taken according to the disclosure may then be analyzed todetectfeatures on the LVL billet.'
Run Code Online (Sandbox Code Playgroud)
以上是我的输出.现在我想在Python中摆脱"\n".
我怎么能意识到这一点?我应该使用re模块吗?我text用来表示以上所有文字,text.strip("\n")根本没用.为什么?
谢谢!
对于字符串s,执行:
s = s.strip("\n")
Run Code Online (Sandbox Code Playgroud)
只会删除前导和尾随换行符.
你想要的是什么
s = s.replace("\n", "")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1975 次 |
| 最近记录: |