替换换行符 [英] Replace line breaks

查看:67
本文介绍了替换换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Visual Studio 代码用于几件事.一切正常,但我无法让一件特定的事情发挥作用.

I am using visual studio code for several things. Everything is working fine, but I cannot get one specific thing to work.

我需要能够从文本中删除换行符.

I need the ability to remove line breaks from the text.

示例:

first line
second line

应该变成:

first linesecondline

自从最近更新以来,可以使用 ^$ 搜索换行符.它在这里描述:https://github.com/Microsoft/vscode/pull/314

Since a recent update it is possible to search for line breaks with using ^$. It is described here: https://github.com/Microsoft/vscode/pull/314

我遇到的问题是,当我使用它进行替换时,它实际上会添加"到换行符而不是替换"它.

The problem I have is that when I use this for replacing, it does actually "add" to the line break and does not "replace" it.

推荐答案

最新版本的 VS Code 有一个快捷方式可以删除选择中的中断 (CTRL + J).

The latest version of VS Code has a shortcut to remove breaks from selection (CTRL + J).

这篇关于替换换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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