To display a string enclosed within a double quotes, we
can use,
string str
= "I like \"string\""; -- Output: I
like "string"
string str
= @"Here is my ""quoted""
text."; -- Output: Here is my "quoted" text.
To display a string enclosed within a double quotes
that is assigned
a control value (eg:- label), we can use,
Label1.Text = "String";
string str
= "\"" + Label1.Text + "\""; -- Output: "String"
This should work
ReplyDeletestring str = @"" + Label1.Text + @""; -- Output: "String"
Those examples are ok while printing, but while Passing the string parameter (which contains "Quoted" text), it would pass an additional \(slash) before each "(double quote).
ReplyDelete