[Visualstudio] delete all blank lines in Visual Studio [organize]

Source: Internet
Author: User

This article is reproduced from the blog Park, the original link: http://www.cnblogs.com/k-sharp/archive/2010/05/18/1738264.html [this link has expired]

  • Enter: Ctrl + H
  • Find what: ^: B * $ \ n
  • Replace:[Empty]
  • Look in: current document
  • Find option: use regular expressions
  • Click: replace all

    Regular Expression ^: B * $ \ n, ^ indicates the start of a row, $ indicates the end of a row, B indicates space or tab, and * Indicates 0 or more. \ N indicates a line break.

  • In the find what edit box, click the small arrow on the right to open the regular expression symbol table. Using the regular expression can almost meet most of the search requirements. The following is a complete list of symbols, which is selected from the msdn

    Http://msdn.microsoft.com/en-us/library/aa293063 (vs.71). aspx

    ========================================================== ========================

    Supplement:

    Replace multiple blank rows with one row: ^: B * $ \ n + with \ n

    Delete the blank line before}: ^ [: B \ n] * \}: B * With \}, select all the code, Ctrl-K, Ctrl-F format

    This article is reproduced from the blog Park, the original link: http://www.cnblogs.com/k-sharp/archive/2010/05/18/1738264.html [this link has expired]

  • Enter: Ctrl + H
  • Find what: ^: B * $ \ n
  • Replace:[Empty]
  • Look in: current document
  • Find option: use regular expressions
  • Click: replace all

    Regular Expression ^: B * $ \ n, ^ indicates the start of a row, $ indicates the end of a row, B indicates space or tab, and * Indicates 0 or more. \ N indicates a line break.

  • In the find what edit box, click the small arrow on the right to open the regular expression symbol table. Using the regular expression can almost meet most of the search requirements. The following is a complete list of symbols, which is selected from the msdn

    Http://msdn.microsoft.com/en-us/library/aa293063 (vs.71). aspx

    ========================================================== ========================

    Supplement:

    Replace multiple blank rows with one row: ^: B * $ \ n + with \ n

    Delete the blank line before}: ^ [: B \ n] * \}: B * With \}, select all the code, Ctrl-K, Ctrl-F format

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.