string 如何在 Notepad++ 中使用退格转义序列?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19334286/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 02:07:23  来源:igfitidea点击:

How to use backspace escape sequence in Notepad++?

stringescapingnotepad++

提问by vergil corleone

I need to use find new lines (\n) in a .txtfile and replace them with a backspace (\b). Using this in the Find and Replace feature of Notepad++ successfully finds the new lines, (\n), but replaces them with the characters "\b" instead of applying a backspace. How can this be done correctly?

我需要\n.txt文件中使用查找新行 ( )并用退格 ( \b)替换它们。在 Notepad++ 的查找和替换功能中使用它可以成功找到新行 ( \n),但将它们替换为字符“\b”而不是应用退格。如何正确地做到这一点?

回答by rtyusolf

\r\nshould work.

\r\n应该管用。

replace them with empty field and you will get your backspace(\b) equivalent

用空字段替换它们,你会得到你的退格(\b)等价物

回答by Quotidian

In notepad++,

在记事本++中,

Go to Edit menu, line operations and then click on "Remove Empty Lines" You get what you are trying with regular expression.

转到编辑菜单,行操作,然后单击“删除空行”您就可以使用正则表达式进行尝试。

Removing empty lines

删除空行

enter image description here

在此处输入图片说明

回答by Monster Brain

A simple way would be Ctrl+ Jor Edit->Line Operations->Join Lines

一个简单的方法是Ctrl+J或 Edit->Line Operations->Join Lines

I was also trying to replace \n with backspace, but the above solutions seems neat. Maybe it helps someone.

我也试图用退格替换 \n,但上述解决方案似乎很简洁。也许它可以帮助某人。

(I tried the \r\n solution and it seems both works the same way :) )

(我尝试了 \r\n 解决方案,似乎两者的工作方式相同:))