Remove unwanted blank line eclipse editor

2020-06-03 01:30发布

问题:

When i open any file in eclipse. it show alternative blank line after all the code lines and blank line. how can i remove it....

回答1:

In eclipse preference setting you can remove all the unwanted blank lines. Eclipse: Window > Preferences > Java > Code Style > Formatter > Edit the formatter and following screen will pop up.

And when you format the code all unwanted blank lines will be removed.



回答2:

Find: ^\s*\n

Replace with: (empty)



回答3:

Maybe you didn't understand what Anshu said. Do a Ctr-F on your editor. In the options, select Regular Expression. Enter ^\s*\n for the Find expression. Keep the Replace box empty. Replace All!

This of course might lead to removal of unwanted lines as well.



回答4:

Due to your eclipse setting.

you can change your setting from preferences.



回答5:

  1. Find and replace as Regular Expressions with ^\s*\n
  2. Press Ctrl + Shift + f
  3. Press Ctrt + Shift + o