tags:

views:

189

answers:

2

I would like to be able to paste chunks of XML into my C# code.

However, the best I can do is the following, but then I have to search and replace " with "".

Is there a way to define multiline XML in C# code without having to alter the XML text like this?

        public static string GetXml1()
        {
            return @"
<Customer>
  <FirstName status=""required"">Jim</FirstName>
  <LastName status=""required"">Smith</LastName>
</Customer>
";
        }
A: 

Not necessarily what you are askin for, but Box/Column Select might help if the lines are alligned. Just hold down the 'Alt'-key while you use the mouse to select the " you want to remove and press delete.

erikric
+4  A: 

Store the XML as a string resource then retrieve the XML as using ResourceManager.

AnthonyWJones