我开始写一条消息,但不知道是否需要插入它。所以,我在消息中间,想要放一个$来插入我的字符串。
如果它有一些捷径,那将是很有帮助的。
如下所示:
Log("Something happen here, at... (Oh God, I will need interpolate it..) {DateTime.Now}...");有吗?
发布于 2019-02-05 03:13:09
使用Resharper,你可以按alt+enter,第一个建议是"to string interpolation“。

发布于 2019-02-05 18:39:52
您可以添加以下命令到视觉指挥官,并为其分配一个快捷方式:Add the string interpolation character $ to the beginning of the current string。
发布于 2019-02-05 03:11:51
您可以在下面的$中使用它
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/
https://stackoverflow.com/questions/54522368
复制相似问题