Visual Studio 删除空行 Visual Studio 没有提供此功能,只能用正则表达式,具体做法如下: 一、ctrl+ H 打开替换框 二、在替换框中的源中输入 ^(?([^ ])s)* ?$ ? 图如下: 完毕