【问题标题】:I cant remove \n in a long string, tried everything and it prints out all \n我无法删除长字符串中的 \n,尝试了所有内容并打印出所有 \n
【发布时间】:2022-06-12 16:34:03
【问题描述】:
'\nAdapters\nAirfreeSchlenkGlassware\nAmpuls\nArsineGenerator\nBaffles\nBalances&Accessories\n'

这是字符串,我尝试了所有建议的解决方案,但没有任何效果,我不知道这里有什么问题。 它首先是一个列表,但我将其转换为字符串以尝试正则表达式、拆分、替换...... 我需要像列表一样的输出

[Adapters, Airfree Schlenk Glassware, Ampuls..]

【问题讨论】:

  • 请分享您尝试使用的代码 - 没有它就无法说明为什么您会得到这个。 How to ask

标签: python string newline


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-07-19
  • 2021-11-14
  • 2021-03-04
  • 2012-10-19
  • 1970-01-01
  • 1970-01-01
  • 2014-11-08
相关资源
最近更新 更多