How can I append text to a start and end of a file as header and footer ?

Posted by Morano88 on Stack Overflow See other posts from Stack Overflow or by Morano88
Published on 2010-04-16T19:05:31Z Indexed on 2010/04/16 19:13 UTC
Read the original article Hit count: 299

Filed under:
|
|

I'm filling an XML document manually using C# and I need to have <data> as header and </data> as footer for the whole XML file. Is there an easy way to do that ? I know It can be done but I couldn't find a way to do it. Keep in mind that I'm updating the entries so I need to make sure that they always come between the header and the footer.

Thanks

Example

<data>

Entry
New Entry 1
New Entry 2

</data>

© Stack Overflow or respective owner

Related posts about c#

Related posts about string-manipulation