Remove blank line in Eclipse

前端 未结 7 1554
梦毁少年i
梦毁少年i 2021-01-30 01:45

How can I remove lines that only contain spaces when using Eclipse Find/Replace prompt. I checked the \"Regular Expression\" check box, and tried the following, neither of whic

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 02:12

    1. for the find/replace operation, "\n\r\s" regex will work on windows, for unix based system, "\n\s" can be used
    2. as already suggested, you can format your code by Ctl+Shift+F
    3. for manual work, locate a blank line and press Ctl+D (Cmd+D on Mac) <- gives u satisfaction of killing the line with your own bare hands :)

    cheer!

提交回复
热议问题