Successfully added
Quotes
by Patrik
Escape Double Quotes in C#
This Set will discuss methods to escape double quotes in C#.
...see more
If we want to save a string like He said, "Hi", we have to use the double quotes escape character "" in C#. We have to enclose the double quotes inside another pair of double quotes like ""Hi"" to store this inside a string variable like "Hi". The following code example shows us how we can escape double quotes with the "" escape character in C#.
string msg = @"He said ""Hi"""; Console.WriteLine(msg);
Output:
He said "Hi"
We saved the string msg with the value He said "Hi" by using the "" escape character in C#.
Referenced in:
Comments