dcsimg
Results 1 to 3 of 3

Thread: [RESOLVED] Remove blank lines in IDE - VS2017

  1. #1

    Thread Starter
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,281

    Resolved [RESOLVED] Remove blank lines in IDE - VS2017

    Looked for a solution to remove blank lines in all my code (IDE).

    This is what I found:

    1. Click Ctrl+H (quick replace)
    2. Tick "Use Regular Expressions"
    3. In Find specify "^$\n"
    4. In Replace box delete everything.
    5. Click "Replace All"
    All Blank lines will be deleted.
    ^ Means Beginning of line
    $ Means End of line
    And

    1. Click Ctrl+Shift+H
    2. In Find specify "^$\n"
    3. In find check Use Regular Expressions.
    4. In Replace box leave blank
    5. Click "Replace All"
    All Blank lines will be deleted.
    ^ Means Beginning of line
    $ Means End of line
    In both attempts, get the popup that says "Can't find ^$\n"

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,544

    Re: Remove blank lines in IDE - VS2017

    Your Regular Expression patter is wrong. You need:
    Code:
    ^\s+$[\r\n]*
    Fiddle: http://regexr.com/3g9se

  3. #3

    Thread Starter
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,281

    Re: Remove blank lines in IDE - VS2017

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width