@param string $value
@param string $search
@param string $replace

@return mixed
968815
public function process($value, $search, $replace)
    {
        $search = (array)$search;
        $cnt    = count($search);

        for ($i = 0; $i < $cnt; ++ $i) {
            // Credits for this to Monte Ohrt who made smarty's regex_replace modifier
            if (($pos = strpos($search[$i], "\0")) !== false) {
                $search[$i] = substr($search[$i], 0, $pos);
            }

            if (preg_match('#[a-z\s]+$#is', $search[$i], $m) && (strpos($m[0], 'e') !== false)) {
                $search[$i] = substr($search[$i], 0, - strlen($m[0])) . str_replace(array(
                        'e',
                        ' '
                    ),
                        '',
                        $m[0]);
            }
        }

        return preg_replace($search, $replace, $value);
    }
100033
function replace($search,$replace){
		$this->_String = str_replace($search,$replace,$this->_String);
	}
122236
public function createFilter($search, $replace)
    {
        if (!isset($this->filters[$search][$replace])) {
            if (!isset($this->filters[$search])) {
                $this->filters[$search] = [];
            }

            if (!isset($this->filters[$search][$replace])) {
                $this->filters[$search][$replace] = [];
            }

            $this->filters[$search][$replace] = new Swift_StreamFilters_StringReplacementFilter($search, $replace);
        }

        return $this->filters[$search][$replace];
    }
786275
public static function replaceArray($search, array $replace, $subject)
    {
        foreach ($replace as $value) {
            $subject = static::replaceFirst($search, $value, $subject);
        }

        return $subject;
    }
386280
protected function replaceFirstSequentially($search, array $replace, $subject, $encoding, &$count)
	{
		$offset = 0;
		$lenSearch = mb_strlen($search, $encoding);
		foreach ($replace as $value) {
			$subject = $this->replaceFirstOne($search, $value, $subject, $encoding, $count, $offset, $lenSearch);
			if($offset === false)
				break;
		}
		return $subject;
	}
496811
protected function replaceLastOne($search, $replace, $subject, $encoding, &$count, &$offset = null, $lenSearch = null)
	{
		$target = mb_substr($subject, 0, $offset, $encoding);
		$position = mb_strrpos($target, $search, 0, $encoding);

		if ($position === false){
			$offset = false;
			return $subject;
		}

		$lenSearch = is_null($lenSearch) ? mb_strlen($search, $encoding) : $lenSearch;

		$start = mb_substr($subject, 0, $position, $encoding);
		$end = $replace.mb_substr($subject, $position+$lenSearch, null, $encoding);

		$offset = -mb_strlen($end, $encoding);
		++$count;

		return $start.$end;
	}
299223
public function replace($search, $replace): ClassDeclaration
    {
        $this->constants->replace($search, $replace);
        $this->properties->replace($search, $replace);
        $this->methods->replace($search, $replace);

        return $this;
    }
1262522
public static function replace($string = false, $find = false, $replaceWith = '') {

        if ($string && $find) {

            return str_replace($find, $replaceWith, $string);
        }

        return false;
    }
1113365
public static function replaceSuffix(string $s, string $search, string $replacement = ''): string
	{
		if (substr($s, -strlen($search)) === $search) {
			$s = substr($s, 0, -strlen($search)) . $replacement;
		}

		return $s;
	}
280286
function ireplaceF ($search, $replace)
	{
		ensure('Search argument',  $search,  'is_a_string', __CLASS__, __METHOD__);
		ensure('Replace argument', $replace, 'is_a_string', __CLASS__, __METHOD__);

		$this->string = str_ireplace($search, $replace, $this);

		return $this;
	}
47440
public static function replace($search, $replace, $string, $caseSensitive = true)
    {
        if (!self::isValid($replace)) {
            return false;
        }

        if (!$caseSensitive) {
            return str_ireplace($search, $replace, $string);
        } else {
            return str_replace($search, $replace, $string);
        }
    }
1030240
public static function replace(string $str, string $find, $replace = ''): string
    {
        return ($position = strpos($str, $find)) !== false ? substr_replace($str, $replace, $position, strlen($find)) : $str;
    }
387843
public function replace($search, $value) {
        $this->value = str_replace($search, $value, $this->value);
    }
979050
public function filter($value)
    {
        $replace = $this->getReplaceCallback();
        $filtered = $value;

        foreach ($this->patterns as $index => $pattern)
        {
            $filtered = preg_replace_callback($pattern, $replace[$index], $filtered);
        }

        return $filtered;
    }
881806
public function replaceOneValue($search, $replacement = ''): self
    {
        $array = $this->getArray();
        $key = \array_search($search, $array, true);

        if ($key !== false) {
            $array[$key] = $replacement;
        }

        return static::create(
            $array,
            $this->iteratorClass,
            false
        );
    }
891541
private function replaceBasic($searchFor, $replaceWith)
    {
        if ($this->isPrefixUsed()) {
            $searchFor = $this->globalPrefix . $searchFor;
        }

        $this->doReplace($searchFor, $replaceWith);
    }
761755
final protected static function replaceKey($data, $search, $replace)
    {
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $data[$key] = $value = self::replaceKey($data[$key], $search, $replace);
            }
            if ($key == $search) {
                $data[$replace] = $value;
                unset($data[$search]);
            }
        }

        return $data;
    }