skip to Main Content

I want to delete all comments in an android project, all the comments start with // or any other specific characters?

2

Answers


  1. Chosen as BEST ANSWER

    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+@.*$


  2. to delete all the comments just use CTRL + r and write ^s+//.*$ in first box

    but make sure to check the box Regex

    and in second write no thing and press replace all as shown below
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search