Tips: Remove all comments from the java files in Eclipse IDE

By | October 19, 2016

1) Open the java file in which comments are to be removed.
2) Press Ctrl+F if you are using windows, Cmd+F in Mac OS.
3) Select Regular Expressions in the Find Menu.
4) Replace the below two expressions with empty string:

i) (//[^\n]*)
ii) (?s)/\*.*?\*/

5) This action will remove all the comments -> Single Line as well as multiple line comments from the java file.

1,797 total views, 14 views today

(Visited 466 times, 9 visits today)