我开始写的消息,但不知道如果我需要它插。所以,我在消息的中间,并希望把一个$
内插我的字符串。
如果一些快捷方式存在,那将是有益的。
像这样:
Log("Something happen here, at... (Oh God, I will need interpolate it..) {DateTime.Now}...");
是否有一个?
您可以添加以下命令到Visual指挥官,并分配一个快捷方式:Add the string interpolation character $ to the beginning of the current string。
您可以在以下情况下与$
使用它:
Log($"Something happen here, at... (Oh God, I will need interpolate it..) {DateTime.Now}...");
使用它之前,你需要安装Microsoft.Net.Compilers
包的更多信息:https://blogs.msdn.microsoft.com/benjaminperkins/2017/03/23/how-to-enable-c-7-in-visual-studio-2017/