FindAndReplace in TStrings

Hello everybody.

I am looking for a way of searching a TString (say haystack) by another TString (say foo) and replacing it by a third (say bar). In PHP this is done by the function str_replace, i.e. the statement would look something like

In C++, one could program this oneself by making use of string::find and string::replace. However, string ain’t TString. I looked through the manual, but it appears to me, that there only is a function for searching for the first and last appearence of a single char in a TString. So,
have I overlooked something or is there no way of implementing the find-procedure for TStrings like it is available for ordinary strings? Or does any of you have a better idea how I could solve this issue?

Thank you in advance.

TString::operator() (…)

Okay it’s pretty obvious though I missed that. Thanks.

This kind of thing is why I’d like the auto-generated documentation to “collapse” overloaded methods so you can more effectively see what a class can do. There’s no need to have separate sections for TString::Insert taking a const char * and a TString, or ten different listings for TString::operator++ taking a numeric type.

I’m guessing this is because ROOT doesn’t use templates much and instead uses explicit overloads for all types that a function accepts.