我需要打印
a
"b"
c
使用verbatim字符串,我在这里发了另一个有关多行代码模板的问题here。
我尝试过以下verbatim字符串:
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}"
也不起作用。
有什么问题吗?