How to remove blank lines in VS Code

Recently, I have to use a file in VS Code, which has a few blank lines, and I want to delete them all at once.

We are talking about more than 700 blank lines with some text in the middle, and I don't want to do this manually.

I'm a programmer, so I would rather spend 5 minutes simplifying tasks than spending the same time on annoying tasks.

I searched a bit and found an easy way to do this: replace\n\nwith\n.

Remove empty lines in VS Code

I ran "Replace All" in the file and deleted half of the lines. Therefore, I run it again and again until I reach 1 blank line.

Update:\n\n+All rows will be replaced immediately without repeating the operation