如何删除所有 C# 方法/属性/字段“摘要”注释
(以 开头///)
在 Visual Studio 的当前文档中一枪?
换句话说,转换这个:
/// <summary>
/// Very stupid comment generated with very stupid tool
/// </summary>
protected void MyMethod
{
}
进入这个:
protected void MyMethod
{
}
如何删除所有 C# 方法/属性/字段“摘要”注释
(以 开头///)
在 Visual Studio 的当前文档中一枪?
换句话说,转换这个:
/// <summary>
/// Very stupid comment generated with very stupid tool
/// </summary>
protected void MyMethod
{
}
进入这个:
protected void MyMethod
{
}
怎么样
Use:Regular expressionsFind what在表达式后面的字段中输入^.*\/\/\/.*$\n(很快 - 与///模式一致)Replace with将字段留空Look in在Current DocumentReplace All正则表达式模式^.*\/\/\/ ?<summary>.*\n(?:^.*\/\/\/.*$\n)*在这种情况下会更合适,因为它会一次匹配整个摘要注释。
^.*\/\/\/ ?<summary>.*\n- 匹配/// <summary>文本行(斜线后有可选空格)(?:)+- 非捕获组,重复零次或多次^- 行首.*- 任何字符\/\/\/- 三个斜线.*- 任何字符$- 行结束\n- 换行符