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.

28,050 total views, 1 views today

(Visited 16,394 times, 1 visits today)