在 C# 中,如果你想创建一个插值字符串,你可以在定义前面使用美元符号 ($),例如
string myValue = "foo"
string myInterpolatedString = $"This is an example of interpolation: {myValue}";
如果要创建一个逐字字符串,它会忽略除双引号之外的所有转义字符,它允许多行字符串" +
在每行的末尾和"
每个新行的开头都没有笨拙,请使用 at 符号 ( @) 在定义前面,例如
string myVerbatimString = @"This is an example of
a verbatim string";
如何结合这两个功能?