How do I auto-remove trailing whitespace in Android Studio?

前端 未结 4 1205
别跟我提以往
别跟我提以往 2020-12-15 15:13

Similar to the question for eclipse,

  • How can I auto-remove trailing whitespace from the entire file being edited?
  • How can I auto-remove trailing whit
相关标签:
4条回答
  • 2020-12-15 15:44

    In Window You can use Ctrl + alt + enter reformat code in your Android studio it is best way indent code properly manner

    0 讨论(0)
  • 2020-12-15 15:49

    You can also enable it on save via the following preference (Editor -> General -> Other):

    enter image description here

    And for those wondering,

    "Always keep trailing spaces on caret line"

    If this option is selected, trailing spaces will not be stripped on the line where the caret is placed on save operation (for example, when you switch to another window).

    (bigger image)

    0 讨论(0)
  • 2020-12-15 15:51

    Ha, it's as simple as Code->Reformat code... (option-cmd-L)

    0 讨论(0)
  • 2020-12-15 15:59

    A simple shortcut to do this easy is just Ctrl + alt + L .

    0 讨论(0)
提交回复
热议问题