我需要打印
a
"b"
c
使用 vebatim 字符串,我在这里提出了另一个关于多行代码模板的问题。
我尝试使用逐字字符串如下:
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}\"
也不行。
怎么了?