博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何在VS Code中删除空行
阅读量:2507 次
发布时间:2019-05-11

本文共 878 字,大约阅读时间需要 2 分钟。

I recently had to work with a file, in VS Code, that had several empty lines I wanted to remove all at once.

最近,我不得不使用VS Code中的文件,其中有几个空行,我想一次将其全部删除。

We’re talking about 700+ empty lines with some text in between, and I didn’t want to do this manually.

我们谈论的是700多个空行,中间有一些文本,我不想手动执行此操作。

I’m a programmer, so I’d rather spend 5 minutes making a task easier rather than spend the same amount of time doing an annoying job.

我是一名程序员,所以我宁愿花5分钟简化任务,也不愿花相同的时间来完成烦人的工作。

I searched a bit and found this simple way to do so: replace \n\n with \n.

我搜索了一下,发现这样做的简单方法:用\n\n替换\n\n \n

Remove empty lines in VS Code

I ran “replace all” inside the file, and half of the lines were removed. So I ran it again, and again and again, until I got to 1 empty line.

我在文件中运行了“全部替换”,并且删除了一半的行。 因此,我一次又一次地运行它,直到到达1个空行。

Update: \n\n+ will replace all lines at once without having to repeat the operation

更新: \n\n+将一次替换所有行,而无需重复操作

翻译自:

转载地址:http://rxmgb.baihongyu.com/

你可能感兴趣的文章
基于.net的aop实现技术
查看>>
桦仔 笔记7-徐 SQLSERVER日志记录机制
查看>>
下滑线驼峰互转
查看>>
Xcode 快捷键
查看>>
table_open_cache
查看>>
Java中super的几种用法并与this的区别
查看>>
C#利用NPOI操作Excel文件
查看>>
彻底了解指针数组,数组指针,以及函数指针 .
查看>>
浏览器兼容问题【转】
查看>>
python编程 之 PyMysql包接口,python中如何使用数据库
查看>>
WinForm 简单蒙版实现控件遮盖
查看>>
ASP.NET MVC ValueProvider小结
查看>>
ES6之路第二篇:变量的解构赋值
查看>>
iOS6新特征:UICollectionView介绍
查看>>
分享一个基于Bootstrap的 ACE框架 入门(MVC+EF)
查看>>
增量关联规则挖掘—FUP算法
查看>>
spring相关—AOP编程—切入点、连接点
查看>>
animation_Frame动画图片轮播
查看>>
BZOJ 4195 - 离散化 + 并查集
查看>>
Oracle常用数据类型
查看>>