locked
VS2005 trailing spaces RRS feed

  • Question

  • Hi Experts ..


    AFAIK, using Edit Menu > Advanced > Format Document is used to format the code and remove TRAILING SPACES.
    but it seems that does not work in case of trailing spaces in the documentation

            /// <summary>               (Format document does not remove trailing spaces in this line)
            /// Represents an array   (Format document does not remove trailing spaces in this line)
            /// </summary>              (Format document does not remove trailing spaces in this line)
            private readonly string[] array;


    Can I customize VS2005 to remove trailing spaces in this case?
    Sunday, September 16, 2007 11:03 AM

Answers

  • No, but it's not hard to build a program that can:

    string file = "C:\example.cs";

    string[] lines = System.IO.File.ReadAllLines(file);
    for(int i = 0; i <lines.Length; i++){
      linesIdea = linesIdea.Trim();
    }


    System.IO.File.WriteAllLines(file, lines);
    Sunday, September 16, 2007 3:26 PM