Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   string (stream) stuff function (http://www.velocityreviews.com/forums/t446879-string-stream-stuff-function.html)

dave 07-06-2005 02:27 PM

string (stream) stuff function
 
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,newinser t)
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




Geo 07-06-2005 02:49 PM

Re: string (stream) stuff function
 
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);
}


Geo 07-06-2005 02:54 PM

Re: string (stream) stuff function
 
Sorry, didn't mean to top post... Google blah, blah, blah....


Geo 07-06-2005 03:00 PM

Re: string (stream) stuff function
 
Geo wrote:
> 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 !!!!!


dave 07-06-2005 08:09 PM

Re: string (stream) stuff function
 
thanks...im new to c/c++ slowly getting there...thanks for the help
dave

"Geo" <gg@remm.org> wrote in message
news:1120661350.592545.132430@f14g2000cwb.googlegr oups.com...
> 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);
> }
>





All times are GMT. The time now is 07:48 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.