Michał Kuliński Michał Kuliński - 5 days ago 5
C# Question

How to remove all C# methods/properties/fields "summary" comments (starting with ///) in current document in Visual Studio with one shot?

How to remove all C# methods/properties/fields "summary" comments

(starting with

///
)

in current document in Visual Studio with one shot?

In other words convert this:

/// <summary>
/// Very stupid comment generated with very stupid tool
/// </summary>
protected void MyMethod
{

}


Into this:

protected void MyMethod
{

}

Answer

How about

  • Ctrl+H for quick replace
  • Mark Use : Regular expressions
  • Enter in Find what field following expression ^.*\/\/\/.*$\n (shortly - line with /// pattern)
  • Leave Replace with field empty
  • Make sure that you Look in in Current Document
  • Click Replace All
Comments