string replace function

G

Guest

Can anyone point me to a string function that will search a string for
the following 4 characters & > < " and replace them with &amp, &lt,
&gt, &quot.

That is a search and replace function.

Thanks if you can help.

Enda
 
T

Tom Smith

Can anyone point me to a string function that will search a string for
the following 4 characters & > < " and replace them with &amp, &lt,
&gt, &quot.

The 'find...' family of member functions of the std::string class will
do the job for you: you can easily put these together to do what you want.
A good reference for them (and in fact for the whole of C++) is here:
http://www.codeguru.com/cpp/tic/tic0180.shtml.

Good luck!


Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,274
Latest member
JessMcMast

Latest Threads

Top