Issue
I am using Eclipse - mars. I need to replace tab character with white spaces in existing code. I did this:
Open Window->Preferences from menu bar.
Select Text Editors from tree menu.
Uncheck Insert spaces for tabs.
But this doesn't replace for existing code. Is there any simple way to do that, considering I have some 25 java files to do this.
Solution
After you have changed your settings, you need it to be applied it to your code files. This can be done by formatting your code.
- Windows: Ctrl + Shift + F (Control + Shift + F)
Mac: ⌘ + Shift + F (Command + Shift + F)
Main menu: main menu > Source > Format
(from the answer How to auto-format code in Eclipse?)
As @StephaneM suggested:
Change your code style formatter to remove white spaces before and after assignments
To remove the whitespace before and after assignments (=
).
Answered By - Luke Melaia
Answer Checked By - David Marino (JavaFixing Volunteer)