Is it possible to delete all comments in my code (Android Studio)?

I am working on projects in the android studio, and there are a lot of comments in it, is it possible to delete all comments (both a single line // and a multi-line line /* ) in the code? It is preferable to deal with Regex ..

+6
source share
1 answer

If you do not want to comment on the code that you are exporting, IntelliJ should not export your comments. However, if you want to really delete comments in the whole project, you can delete comments /* x */ using REGEX. For // comments, you can also use REGEX, but do not do this so as not to delete all the code.

For /* x */

 \/\*([\s\S]*?\*\/) 

For //

 \/\/.* 
+4
source

All Articles