Remove unwanted blank line eclipse editor

寵の児 提交于 2019-12-03 17:15:18

问题


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


来源:https://stackoverflow.com/questions/12740086/remove-unwanted-blank-line-eclipse-editor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!