There is a thread with the same name, but I could not add my question there.
I am trying to include double quotes in a string in C#. It seems straightforward but I could not do it. The below line is taken from msdn (msdn.microsoft .com/en-us/library/aa691090(VS.71) .aspx )
string e = "Joe said \"Hello\" to me"; // Joe said "Hello" to me
string f = @"Joe said ""Hello"" to me"; // Joe said "Hello" to me
e and f must have the value, Joe said "Hello" to me, (at least the comments say so) but they do not have.
They have the value: Joe said \"Hello\" to me.
While debugging I open the Text Visualizer, HTML Visualizer, and XML Visualizer screens for e and f strings. They all show the string's value as Joe said "Hello" to me. But in the code they do not have that value.
Thanks for any comment,
Halil
I am trying to include double quotes in a string in C#. It seems straightforward but I could not do it. The below line is taken from msdn (msdn.microsoft .com/en-us/library/aa691090(VS.71) .aspx )
string e = "Joe said \"Hello\" to me"; // Joe said "Hello" to me
string f = @"Joe said ""Hello"" to me"; // Joe said "Hello" to me
e and f must have the value, Joe said "Hello" to me, (at least the comments say so) but they do not have.
They have the value: Joe said \"Hello\" to me.
While debugging I open the Text Visualizer, HTML Visualizer, and XML Visualizer screens for e and f strings. They all show the string's value as Joe said "Hello" to me. But in the code they do not have that value.
Thanks for any comment,
Halil
Comment