How can I remove all comments in the whole project from Netbeans?
I need to change the code, but it has so many unused comments like this:
/* 6: */ import java.util.List;
/* 7: */ import org.apache.ibatis.session.SqlSession;
/* 8: 7 */ import org.apache.ibatis.session.SqlSessionFactory;
/* 9: */ import org.apache.log4j.LogManager;
/* 10: */ import org.apache.log4j.Logger;
source to share
I can give one alternative way. I'm using this method.
there is an option in netbeans search and replace
, so you can enable the regex option, then enter a regex to match the comments and replace the empty .go with edit
and then replace
. use regex
/\\*.*?\\*/
to match the /*comment*/
style comment
edit > replace
Example
It's not hard for me to create netbeans
addon
to do this with a button.
and rectangular selection tool
can also be useful multiple times if the area is a rectangle
Example
source to share