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
How to use backspace escape sequence in Notepad++?
提问by vergil corleone
I need to use find new lines (\n
) in a .txt
file 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\n
should work.
\r\n
应该管用。
replace them with empty field and you will get your backspace(\b
) equivalent
用空字段替换它们,你会得到你的退格(\b
)等价物
回答by Quotidian
回答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 解决方案,似乎两者的工作方式相同:))