Connecting Tech Pros Worldwide Help | Site Map

string replace function

keepyourstupidspam@yahoo.co.uk
Guest
 
Posts: n/a
#1: Oct 2 '06
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

Tom Smith
Guest
 
Posts: n/a
#2: Oct 2 '06

re: string replace function


keepyourstupidspam@yahoo.co.uk wrote:
Quote:
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
Closed Thread