C# Language Verbatim Strings Escaping Double Quotes

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

Double Quotes inside verbatim strings can be escaped by using 2 sequential double quotes "" to represent one double quote " in the resulting string.

var str = @"""I don't think so,"" he said.";
Console.WriteLine(str);

Output:

"I don't think so," he said.

Live Demo on .NET Fiddle



Got any C# Language Question?