src/Generic/common/LocatedString.cpp
/** Find any occurance of the string 'find' and replace with 'repl'.
	*	See above description of how the offsets of the replacement characters are set.
	*	This replace continues to look where it last found an occurance of 'find'
	*	So if 'find'="&amp;" and 'repl'="&", then "&amap;amp;amp" will be replaced with "&"
	*/
Find any occurance of the string 'find' and replace with 'repl'.
See above description of how the offsets of the replacement characters are set.
Find any occurance of the string ' find ' and replace with ' repl ' . See above description of how the offsets of the replacement characters are set .
void LocatedString::replaceRecursive(const std::wstring & find, const std::wstring & repl) {
	int find_len = static_cast<int>(find.length());
	int start = 0;
	while(start < length()) {
		int pos = indexOf(find.c_str(), start);
		if(pos == -1)
			return;
		replace(pos, find_len, repl.c_str());
		start = pos;
	}
}
void LocatedString :: replaceRecursive ( const std :: wstring & find , const std :: wstring & repl ) { int find_len = static_cast < int > ( find . length ( ) ) ; int start = 0 ; while ( start < length ( ) ) { int pos = indexOf ( find . c_str ( ) , start ) ; if ( pos == -1 ) return ; replace ( pos , find_len , repl . c_str ( ) ) ; start = pos ; } }
Find any occurance of the string 'find' and replace with 'repl'.
Find any occurance of the string ' find ' and replace with ' repl ' .