Visual Studio wrap selection in quotes?

后端 未结 4 981
栀梦
栀梦 2021-02-05 13:39

Is there is a way to wrap a selected text block with quotes? In visual studio I have not found a extension or plugin I am just looking for a simple way to do it. Is there a way

4条回答
  •  难免孤独
    2021-02-05 13:53

    You can use the following command (C# language) with my Visual Commander extension to wrap a selected text block with quotes:

    public class C : VisualCommanderExt.ICommand
    {
        public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package)
        {
            EnvDTE.TextSelection ts = DTE.ActiveDocument.Selection as EnvDTE.TextSelection;
            ts.Text = '"' + ts.Text + '"';
        }
    }
    

提交回复
热议问题