python - 如何在使用 python 时添加一行
问题描述
您好,我想知道如何转换它。
0|13|16|16|3|"After MLG down and securely locked, a red light is illuminated \
n the flight deck. The possible causes are." \
|out of adjustment sensor|wiring problem|shorted sensor|b|1| |zita-2686
进入这个
0|13|16|16|3|"After MLG down and securely locked, a red light is illuminated the flight deck. The possible causes are." |out of adjustment sensor|wiring problem|shorted sensor|b|1| |zita-2686
你能帮帮我吗,因为我没有找到类似的东西
解决方案
有很多方法可以用空替换换行符。尝试以下任何方法。
string = string.replace("\r","");
or
string = string.replace("\r\n","");
or
string = string.replace("\n","");
or
re.sub(r'\s' , '\n', line);
推荐阅读
- javascript - TextArea 问题 - 键入时尖括号内的文本消失
- python - 使用字典设置函数参数时遇到问题
- ios - 是否可以在 iOS 中读取 xcassets 文件夹?
- laravel - Laravel 和 VueJs 分页没有正确显示所有记录
- java - 发送 post 请求后无法从标头 rsponse 获取令牌
- java - 使用 Apache Avro 生成的文件构建错误
- mysql - Web.Config 使用 mysql 数据库中的名称重写 URL
- c++ - 将 uint_8 更改为 x 次二进制 1 MSB
- python - 使用 Python 抓取需要从另一个 url 访问的网页
- react-native - react-native-swiper 奇怪的行为