views:

98

answers:

1

I expected that there is no something wrong but VS2010 gives error.

string s= @"somet"hing";

+9  A: 

You need to double-up quotation marks within an @ string.

string s = @"somet""hing";

Otherwise how would it know which quotes were escapes and which were the end markers?

Refer to the MSDN string page.

Mark Rushakoff
Yeck, VB Syntax ...
C. Ross
<rootxmlns:h="http://www.w3.org/TR/html4/"xmlns:f="http://www.w3schools.com/furniture"><h:table> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr></h:table><f:table> <f:name>African Coffee Table</f:name> <f:width>80</f:width> <f:length>120</f:length></f:table></root>can u put it all of this into a string ? quotation marks are already doubled in it.
Freshblood
or give idea how to put it into a string in easy way
Freshblood
@Freshblood: @"<root xmlns:h=""http://www.w3.org/TR/html4/"" xmlns:f=""http://www.w3schools.com/furniture""> <h:table> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr> </h:table> <f:table> <f:name>African Coffee Table</f:name> <f:width>80</f:width> <f:length>120</f:length> </f:table> </root>"
dtb
i understand it now.Thanks
Freshblood