How to delete all comment lines in IDEA?

I am looking for a quick way to get rid of all comments in a file.

Search for keyboard shortcuts or quick and easy alternatives.

Any suggestions?

EDIT

I would like, in particular, to remove only commented lines, therefore those that start with //, rather than block comments, which are usually intended for java-doc.

+4
source share
2 answers

You can use Find and Replace ( Ctrl/Cmd+ R). Search only in comments (option under the small cog menu), enable regular expression search and line search ^//.*. Replace the empty string.

+8
source

, /

-2

Source: https://habr.com/ru/post/1617573/


All Articles