string (stream) stuff function

D

dave

hi im looking for a down n dirty blazing fast stuff function
or sample how to write one my self
for example:
newstring=stuff(origstring,nstart,chrsdel,newinsert)
1. orgstring is the original for instance a page from a document
2 beginning position
3. how many chars to delete
4. string,chars to insert at Nstart point

thanks for all the help
dave
 
G

Geo

It was blazingly fast to write...

std::string f(const std::string &o, const std::string &n, int insert,
int del)
{
return
std::string(o,0,insert)+n+std::string(o,insert+del,std::string::npos);
}
 
G

Geo

Geo said:
Sorry, didn't mean to top post... Google blah, blah, blah....

!!!! oh I didn't, what's going on here, why won't they let me use a
proper news reader !!!!!
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top