U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » no String::Replace() ?
Re: no String::Replace() ? [message #11279 is a reply to message #11274] Thu, 30 August 2007 16:23 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Seem OK, but perhaps a little bit slow. I think the fast method would be to recreate String - insertion into String can be expensive.

I would do e.g.:

String es;
for(const char *q = s; *q; q++) {
    es.Cat(*q);
    if(*q == '\'')
       es.Cat('\'');
}


As for inclusion of some Replace to String.h, well, why not, but perhaps not as member function. It is also the question how generic it should be (what you need is sort of special case that can be handled more effectively).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Compile errror in ctrllib/update.cpp
Next Topic: PROPOSAL: SerializeStore helper
Goto Forum:
  


Current Time: Sat May 30 21:24:37 GMT+2 2026

Total time taken to generate the page: 0.00692 seconds