我需要打印把”在逐字字符串与C#
a
"b"
c
与vebatim串,我提出了关于多行代码模板here另一个问题
我试图与逐字字符串如下:
using System;
class DoFile {
static void Main(string[] args) {
string templateString = @"
{0}
\\"{1}\\"
{2}
";
Console.WriteLine(templateString, "a", "b", "c");
}
}
但是,我得到这个错误。
t.cs(8,11): error CS1525: Unexpected symbol `{'
t.cs(9,0): error CS1010: Newline in constant
t.cs(10,0): error CS1010: Newline in constant
\"{1}\"
也不工作。
怎么了?
可能重复[我可以在逐字串字面值中使用双引号吗?](http://stackoverflow.com/questions/1928909/can-i-escape-a-double-quote-in-a-verbatim -string-literal) – Ash 2017-03-22 12:28:06