/** * Works like PHP's str_replace function. * * @access public * @param I18N_UnicodeString $find The string to replaced * @param I18N_UnicodeString $replace The string to replace $find with * @return I18N_UnicodeString The current string with all $find replaced by * $replace * @see subStringReplace() */ function stringReplace(&$find, &$replace) { $return = new I18N_UnicodeString($this->_unicode, 'Unicode'); while ($return->strStr($find) !== false) { $after = $return->strStr($find); $begin = $return->subString(0, $return->length() - $after->length()); $after = $after->subString($find->length()); $return = new I18N_UnicodeString(array_merge($begin->_unicode, $replace->_unicode, $after->_unicode), 'Unicode'); } return $return; }