I want to delete all comments in an android project, all the comments start with //
or any other specific characters?
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
2
Answers
Note: I'm answering myself I figure it out
In android studio, right-click on the project and select Replace in files, a new window pop up
1 in the first search field tape in this
^s+//.*$
2 in the second search field, keep it empty if you just want to delete all the lines that start with
//
3 now hit replace all button.
if you want to delete other lines that start with different characters, example
@
the expression should be like this^s+@.*$
to delete all the comments just use CTRL + r and write
^s+//.*$
in first boxbut make sure to check the box Regex
and in second write no thing and press replace all as shown below