skip to Main Content

I need to remove all the comments in the starter app main.dart and other files.
Is there any shortcut commands for the same, in both VS Code and Android Studio?

2

Answers


  1. Chosen as BEST ANSWER

    We may remove all the comments together at once using Regular Expression. Please note rejex mode should be enabled by clicking on .*

    For Android Studio:

    1. Press Ctrl + R
    2. Type //.*
    3. Replace with blank
    4. Click on Replace All button.

    For VS Code:

    1. Press Ctrl + H
    2. Press Alt + R
    3. //.*
    4. Press tab
    5. Ctrl + Alt + Enter
    6. Ctrl + S

    main.dart


  2. You can try the extension Remove Comments it supports a lot of languages.

    It ignores the text inside strings.

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