文字列リテラルにダブルクォートを含める
文字列リテラルにダブルクォートを含めるには、次のようにします。
using System; class Program { static void Main() { Console.WriteLine("<a href=\"http://www.google.co.jp\">Google</a>"); // 逐語的文字列リテラル(vervatim string literal) Console.WriteLine(@"<a href=""http://www.google.co.jp"">Google</a>"); } }
実行結果です。
<a href="http://www.google.co.jp">Google</a> <a href="http://www.google.co.jp">Google</a>