---
title: "eclipse删除空行"
author: "you_java"
date: "2012-03-14T10:04:38Z"
tags: []
categories: ["非技术"]
slug: "eclipse"
draft: false
lastmod: "2012-03-14T10:04:22Z"
id: 1452940
url: "https://you-java.iteye.com/blog/1452940"
---

在eclipse中删除某一行就用ctrl+D快捷键。如果你想删除一个文件中的所有空行呢。

可以用下面方法。

 

1.打开源码编辑器 

2.使用快捷键Ctrl+f 

3.在Find输入框中输入：^\\s\*\\n 

3.Replace With输入框的值为空 

4.在【Options】选中的"Regular expressions" 

5.点击【Replace All】按钮。 

6.OK!