sublimetext2 - Sublime Text 2 : How to delete blank/empty lines

标签 sublimetext2

假设我有一个包含以下九行的文本文件:

foo

bar

baz

qux

quux

如何使用 Sublime Text 2 删除所有四个空白/空行,只留下五行?

最佳答案

选择文字

按:

  • Ctrl + H(PC),或
  • 命令 + 选项 + F(Mac 或)
  • 点击“查找”->“替换”。

确保您已选择“正则表达式”,方法是按:

  • Alt + R(PC 或)
  • 命令 + 选项 + R(Mac 或)
  • 点击查找框中的.*

查找内容:^\n^(\r|\n\r?)

替换为:(什么都没有,留空)。

关于sublimetext2 - Sublime Text 2 : How to delete blank/empty lines,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12008986/

相关文章:

vim - 选择当前单词的多个实例并更改它们的vim方法是什么?

python - 是否可以在 Sublime REPL 选项卡中禁用语法突出显示?

sublimetext2 - Sublime Text 2 : Command To Rearrange Tab In Tab Group

macos - Sublime Text : How to set up begining of line/end of line shortcuts to match the shell?

regex - 正则表达式 Sublime Text 搜索和替换

bash - Sublime text 2 - 如何通过 ssh 运行 shell 命令?

c++ - 无法使用 Sublime Text 2 构建 Allegro 程序

lisp - 普通口齿不清 : Hunchentoot and the REPL - When I start the server I get log output in the REPL and can't use the REPL any more

msbuild - 尝试使用 Sublime Text 到 msbuild 时出现错误 6

sublimetext2 - 有没有办法将所选文本提取到同一目录中的新文件中?