Stats

Contributors: 9 Thursday, April 6, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Escaping Double Quotes

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