<分区>
我对c#有点陌生,我被困在这一点上,
我有一个常规字符串,其中我使用 \
来转义 "
,此处转义意味着转义编译器对 "
的解释,并且"
打印在屏幕上,我得到了预期的输出-->
class Program
{
static void Main(string[] args)
{
string s1 = "This is a \"regular\" string";
System.Console.WriteLine(s1);
System.Console.Read();
}
}
o/p-->这是一个“常规”字符串
现在,我有一个逐字字符串,我正尝试以与上述相同的方式使用 \
转义 "
..-->
class Program
{
static void Main(string[] args)
{
string s2 = @"This is \t a \"verbatim\" string";//this would escape \t
System.Console.WriteLine(s2);
System.Console.Read();
}
}
为什么上面的方法不起作用?