Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > string (stream) stuff function

Reply
Thread Tools

string (stream) stuff function

 
 
dave
Guest
Posts: n/a
 
      07-06-2005
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



 
Reply With Quote
 
 
 
 
Geo
Guest
Posts: n/a
 
      07-06-2005
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);
}

 
Reply With Quote
 
 
 
 
Geo
Guest
Posts: n/a
 
      07-06-2005
Sorry, didn't mean to top post... Google blah, blah, blah....

 
Reply With Quote
 
Geo
Guest
Posts: n/a
 
      07-06-2005
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 !!!!!

 
Reply With Quote
 
dave
Guest
Posts: n/a
 
      07-06-2005
thanks...im new to c/c++ slowly getting there...thanks for the help
dave

"Geo" <> wrote in message
news: 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);
> }
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String Processing Basic Stuff Vishal G Perl Misc 3 10-21-2008 04:41 PM
compilation error: "error: no matching function for call to 'String::String(String)' =?ISO-8859-1?Q?Martin_J=F8rgensen?= C++ 5 05-06-2006 03:48 PM
Silly function call lookup stuff? Lucas Lemmens Python 8 09-28-2005 04:21 PM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
Re: String.replaceAll(String regex, String replacement) question Mladen Adamovic Java 0 12-04-2003 04:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57