通过find / replace(Ctrl + F)删除eclipse代码编辑器中的空行 [英] Remove empty lines in eclipse code editor by find/replace (Ctrl+F)

查看:626
本文介绍了通过find / replace(Ctrl + F)删除eclipse代码编辑器中的空行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过eclipse代码编辑器中的find / replace方法从我的代码中删除所有的空行。



我使用正则表达式 \\\
\s * \\\
查找所有空行,但出错 $$

为什么我收到这个错误?以及如何正确删除空白行?有什么工作替换字符?



这些工作有没有任何eclipse插件?

解决方案

您可以尝试替换以下内容:

  ^ \s * \r?\\\

与空字符串。


I want to remove all blank lines from my code by find/replace method in eclipse code editor.

I used regular expression \n\s*\n to find all blank lines but got error "Incompatible line delimiter near index 55110" when replacing the blank line with any string.

Why i got this error and how to properly remove the blank lines? What will the working replacement character ?

Is there any eclipse plugin for these kind of job?

解决方案

You can try replacing this:

^\s*\r?\n

with the empty string.

这篇关于通过find / replace(Ctrl + F)删除eclipse代码编辑器中的空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆