How do I remove trailing whitespace using a regular expression?

后端 未结 10 2181
无人及你
无人及你 2021-01-30 04:00

I want to remove trailing white spaces and tabs from my code without removing empty lines.

I tried:

\\s+$

and:

([^\\n]         


        
10条回答
  •  执念已碎
    2021-01-30 04:23

    To remove any blank trailing spaces use this:

    \n|^\s+\n
    

    I tested in the Atom and Xcode editors.

提交回复
热议问题