c# - How to assign xml content to a string explicitly -


do know how can explicitlyt assign xml content string ? example :

string myxml = " <?xml version="1.0"?> <note> <to>tove</to> <from>jani</from> <heading>reminder</heading> <body>don't forget me weekend!</body> </note> " 

i want quite bigger file.i need because want use in unit testing shows lots of errors when trying paste content between quotes.

you need verbatim string literal (string starts @ symbol) escaped quotes (i.e. use double "" instead of single "):

        string myxml = @" <?xml version=""1.0""?> <note> <to>tove</to> <from>jani</from> <heading>reminder</heading> <body>don't forget me weekend!</body> </note> "; 

Comments