Responsive Advertisement

How to remove empty lines space in Visual Studio Code

 How to remove empty lines in Visual Studio Code


Method 1:

Here are step by step instructions to remove those empty lines.

  1. Open your code in Visual Studio Code
  2. From Edit Menu, select Replace or use a short cut key (command + Option + F on Mac or Ctrl + H on Windows)
  3. In the find box type \n\n
  4. In the replace box type \n
  5. Make sure the 'Use Regular Expression' is selected
  6. Select 'Replace All' button
     

Method 2:

The above method should remove all the empty line however, if it didn’t then follow these steps:

  1. Open your code in Visual Studio Code
  2. From Edit Menu, select Replace or use a short cut key (command + Option + F on Mac or Ctrl + H on Windows)
  3. In the find box type ^(\s)*$\n
  4. Leave the replace box empty
  5. Make sure the 'Use Regular Expression' is selected
  6. Select 'Replace All' button 

If you can't find the above steps, here is a picture.

How to remove empty lines space in Visual Studio Code


Post a Comment

0 Comments