如何用Xcode中的单个新行代替多个新行,使用Find&更换 [英] how to replace multi new line with single new line in Xcode using Find & Replace

查看:86
本文介绍了如何用Xcode中的单个新行代替多个新行,使用Find&更换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xcode项目中,我们通常编写程序而不注意行间距。

In Xcode projects, we generally write programs without paying attention to line spacing.

因此,在编码完成后,如何使用单行删除所有额外的换行符?

So after coding is complete, how does one remove all those extra newlines with single line?

推荐答案

XCode的查找和替换不支持多行正则表达式。

XCode's find and replace does not support multi-line regular expressions.

如果要搜索多行,您需要将搜索选项设置为文本,然后键入选项+返回两次或复制/粘贴两个新行的字符。

If you want to search for multiple lines you'll need to set your search option to "Textual" and either type option+return twice or copy/paste in two new lines chars. Then replace with a single new line char.

请参阅此处了解详情。

这篇关于如何用Xcode中的单个新行代替多个新行,使用Find&更换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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