【发布时间】:2023-02-21 00:38:38
【问题描述】:
你好,我有一个看起来像这样的字符串
This is a test string This is the second line
我正在尝试打印出这两行并查看实际的 \r 或 \n 字符
所以它会像这样输出
This is a test string\n This is the second line\n
我只试过 print(string variable) 但这给了我没有“\n”或“\r”的字符串
【问题讨论】:
-
请在发布问题之前进行搜索(并显示您搜索过的内容)。
-
给定您的示例字符串,什么规则适用于确定换行符应该出现在哪里?
标签: python