Escaping Double Quotes C# with Example



Escaping Double Quotes C# with 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 

0 Comment's

Comment Form

Submit Comment