Hi, In my program, a text file is read in, and certain parts of it are written to a XML file. There are special characters(e.g. &) that need to be escaped, so I need to escape all of them.
How can I manage to do this?

Sorry, i'm a newer programmer so i am not sure what you mean by the & needs to be escaped, but if you take a look at my thread about regex you may find it helpful. Parsing Lines of a File

TJ

Thanks.

I forgot about CDATA, which keeps text in exactly the same format :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.