0

Given a statement on a single line (line 42) like:

Add(1, 2);

that I want to transform to

Console.WriteLine(Add(1, 2));

my current workflow is to press Ctrl-G 42 Enter Shift-End LeftArrow Ctrl-X c w Tab Tab Ctrl-V End Backspace Backspace. Surely there must be a faster way?

2
  • VSCode or regular Visua Studio? I know both support regex replace, which is likely what you'd want to use. I'd imagine you have at least a couple dozen of these statements you'd want to change?
    – Sam Forbis
    Commented May 13, 2020 at 15:02
  • I'm fine with using both. I'm familiar with regexes and don't have an immediate need to replace many instances now, but the need to wrap statements with Console.WriteLine or other function call snippets does come up often enough for me that I'd like to do that more quickly.. Commented May 13, 2020 at 15:17

0

You must log in to answer this question.

Browse other questions tagged .