简体   繁体   English

Visual Studio Code:如果在该行上找到字符串,如何删除该行文本?

[英]Visual Studio Code: How do I delete a row of text if a string found on that row?

I want to use visual studio code to find a string of text and delete that whole row if the string of text is detected.如果检测到文本字符串,我想使用 Visual Studio 代码查找一串文本并删除整行。

  1. Enter your text in the Find widget在“查找”小部件中输入您的文本
  2. Alt + Enter to select all find matches Alt + Enter to select 全部找到匹配项
  3. Ctrl + L to select the entire line each match is on Ctrl + L到 select 每场比赛的整行
  4. Ctrl + X to cut those lines Ctrl + X剪切这些行

All from the find widget, ie, you don't need to move focus.全部来自查找小部件,即您无需移动焦点。 @rioV8's version works as well with the only difference that you switch focus to the editor during the sequence otherwise essentially the same. @rioV8 的版本也可以正常工作,唯一的区别是您在序列期间将焦点切换到编辑器,否则基本相同。

查找并删除所有匹配项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM