如何删除 Notepad++ 中的特定行? [英] How do I delete specific lines in Notepad++?

查看:78
本文介绍了如何删除 Notepad++ 中的特定行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在清理一些代码文件 (C#) 并想删除这些区域.我想删除所有包含字符串#region"的行.这只是一个例子,我可以想到更多的用途,但这可能吗?

I'm cleaning up some code files (C#) and want to remove the regions. And I would like to delete all the lines that have the string '#region'. That's just an example, and I can think of several more uses, but is that even possible?

推荐答案

您可以使用菜单 Search -> Replace... (Ctrl + H).

You can use menu Search -> Replace... (Ctrl + H).

它具有用于替换的正则表达式功能.您可以使用匹配 #region 以及该行上任何其他内容的正则表达式,并将其替换为空白.

It has a regular expression feature for replacing. You can use a regex that matches #region as well as whatever else is on the line, and replace it with empty space.

这篇关于如何删除 Notepad++ 中的特定行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆