How can I represent the "" characters within a string, for example i have a string
Mary said "The weather is nice today"
Of course i cant do something like this
string phrase = "Mary said "The weather is nice today""
Can anyone help me?
"" representation within a string
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Dave131 reputationPosted Jan 22, 2008, 4:44 AM EST
string phrase = "Mary said \"The weather is nice today\"";
The slash followed by the inverted commas signals to the compiler that those inverted commas are not the end of the string and that they should be displayed as text.
AlanRank #669 · 3.6K reputationPosted Jan 22, 2008, 5:25 AM EST
If your string is 'verbatim' (i.e. preceded by the @ character), you can achieve the same thing by doubling the quotes:
string phrase = @"Mary said ""The weather is nice today""";
kiki23 reputationPosted Jan 23, 2008, 6:30 AM EST
Posted Jan 23, 2008, 8:47 AM EST
string myString = @"This is
a multiline string and
it will be stored like this.";
Pretty cool, lol.