Sublime Text 2: How to delete blank/empty lines

前端 未结 19 1594
北恋
北恋 2020-12-12 09:02

Let\'s say I had a text file with the following nine lines:

foo

bar

baz

qux

quux

How can I use Sublime Text 2 to remove all four of the

19条回答
  •  星月不相逢
    2020-12-12 09:20

    Select the text

    Press:

    • Ctrl + H on PC, or
    • Command + Alt + F on Mac or
    • Click Find->Replace.

    Make sure you have selected 'regular expression' by pressing:

    • Alt + R on PC or
    • Command + Alt + R on Mac or
    • Click .* in the Find box.

    Find what: ^\n or ^(\r|\n\r?)

    Replace With: (nothing, leave in blank).

提交回复
热议问题