删除代码中所有的空行

在Visual Studio中, 可以用正则表达删掉所有的空行

下面是具体操作步骤:

  1. Enter: Ctrl+H
  2. Find what: ^:b*$/n
  3. Replace with: [Empty]
  4. Look in: Current Document
  5. Find Option: Use Regular Expressions
  6. Click: Replace All

这种方法只能对整个文件进行操作, 而不能选中某些行进行操作.

作者:Angelo Lee
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
原文地址:https://www.cnblogs.com/yefengmeander/p/2887727.html