简体   繁体   中英

Is there a way to copy unescaped text variable values in VSC?

What I want is so simple. In Visual Studio Code, I want to copy the value of a text variable from the Watch window into memory.

I understand that, in the watch window, the text is escaped to put everything on one line. In other words,

Hello
world

is displayed as Hello\nworld in the Watch window. That makes sense.

But when I right-click on a string variable in the Watch window and select "Copy Value", I expect the copied value to be

Hello
world

not 'Hello\nworld'

Is there a way to do this in VSC (without the tedious need to search and replace for escape characters)?

(If you're as stumped as me, Upvote in solidarity.)

Old question but here goes:

This may depend on which debugger you are using, the below works in node/JavaScript.

Go to the Debug Console tab, and type the var name or expression at the prompt.

The debugger outputs the value, and you can select and copy it from there.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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