Home >Software Tutorial >Computer Software >A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements
Have you ever encountered extra blank lines or spaces after statements in your code? This affects code readability and maintainability. PHP editor Xigua will introduce you to a simple method to help you automatically delete these redundant contents in Eclipse. By following this guide, you'll learn how to configure your Eclipse settings to automatically clean up excess blank lines and spaces when you save your code, keeping your code clean and organized.
1. Open eclipse, click [Window] on the toolbar, find the [Preferences] option in the pop-up list, and then click this option.
2. The window that pops up now is the common settings window for JAVA developers. We click on [JAVA]>>[Editor]>>[Save Action] , and finally click the mouse on [Save Action].
3. Check [Additional actions].
4. Click [Configure...].
5. The following interface will appear. Just check [Remove trailing whitespace] and select [All lines].
6. Click [OK]
7. Click [Apply], and then click [OK] to complete the setting.
8. [Before setting].
9. "After setting": Excess spaces will be removed after the file is saved.
The above is the detailed content of A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements. For more information, please follow other related articles on the PHP Chinese website!