string s = "/PAGE="Current Page" /Comment="Display screen"/future="Dummy piece";
if i declare like this it shows error, how can i able to declare this as string..
How to declare a quote inside a string
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Sunny SharmaRank #223 · 11.1K reputationPosted Sep 30, 2013, 11:38 PM EDT
You need to use escape character which tells compiler that the following character should not to be interpreted as special character but as string. it is "\".
Here's your modified statement:
------------------------------------------------------------------------------
string s = \"/PAGE=\"Current Page\" /Comment=\"Display screen\"/future=\"Dummy piece\";
------------------------------------------------------------------------------
HTH :)
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 30, 2013, 11:38 PM EDT
use this:
string s = @"/PAGE=""Current Page"" /Comment=""Display screen""/future=""Dummy piece""";