Make the place-holder replacements on a line.

@param  string  $line
@param  array   $replace
@return string
199958
protected function makeReplacements($line, array $replace)
	{
		$replace = $this->sortReplacements($replace);

		foreach ($replace as $key => $value)
		{
			$line = str_replace(':'.$key, $value, $line);
		}

		return $line;
	}
1330565
public function replaceAsset($replace, $with)
    {
        $old = $this->assets()->findOrFail($replace);

        $this->assets()->detach($old->id);
        $old->delete();

        $this->addFile(Asset::findOrFail($with), $old->pivot->type, $old->pivot->locale);
    }
1132906
public function replaceValues($search, $replacement = ''): self
    {
        $array = $this->each(
            static function ($value) use ($search, $replacement) {
                return \str_replace($search, $replacement, $value);
            }
        );

        return $array;
    }
1125126
public function replace(self $find, self $replace){
		return new static(\str_replace($find, $replace, $this->_Value), $this->_Encoding);
	}
1348935
function replace($search,$replace){
		$this->_String = $this->toString();
		return parent::replace($search,$replace);
	}
952508
protected function addPatternAndReplacement($pattern, $replacement)
    {
        $instance = new \stdClass();
        $instance->pattern = $pattern;
        $instance->replacement = $replacement;
        $this->patternsAndReplacements[] = $instance;
    }
1045921
protected function sortReplacements(array $replace)
    {
        return (new Collection($replace))->sortBy(function ($value, $key) {
            return mb_strlen($key) * -1;
        })->all();
    }
1084483
public function replace($search, $replace): Aggregator
    {
        foreach ($this->elements as $element) {
            if ($element instanceof ReplaceableInterface) {
                $element->replace($search, $replace);
            }
        }

        return $this;
    }
373798
static function ReplaceUsing($placeholder, Interfaces\IRealizer $realizer = null)
    {
        $args = func_get_args();    
        array_shift($args);
        if (count($args) >= 2)
        {
            array_shift($args);   
        }
        return self::ReplaceArgsUsing($placeholder, $realizer, $args);
    }
383035
public function replaceOutsideQuotes($search, $replace) {
        
        $this->search = $search;
        $this->replace = $replace;
        return $this->_strReplaceOutsideQuotes();
    }
856083
public function replace($line, $lines, $text)
    {
        if ($lines > 0) {
            $this->delete($line, $lines);
        }
        return $this->insert($line, $text);
    }
20471
public function replace( $string, $pattern, $replacement, $flags = null ){
		$result = $string->value;

		$expr = '/'.str_replace('/','\\/',$pattern->value).'/';
		if( $flags && $flags->value){
			$expr .= self::replace_flags($flags->value);
		}

		$result = preg_replace($expr,$replacement->value,$result);


		if( property_exists($string,'quote') ){
			return new Less_Tree_Quoted( $string->quote, $result, $string->escaped);
		}
		return new Less_Tree_Quoted( '', $result );
	}
632906
public function format(Collection $replacement)
    {
        $replacement = $this->prepare($replacement);
        $messageLines = explode(PHP_EOL, $replacement['message']);
        
        foreach ($messageLines as &$messageLine) {
            $replacement['message'] = $messageLine;
            $messageLine = $this->replace($this->getFormat(), $replacement);
        }
        
        return implode(PHP_EOL, $messageLines);
    }
1322271
protected function sortReplacements(array $replace)
    {
        $results = array();

        $callback = function ($value, $key) {
            return mb_strlen($key) * -1;
        };

        foreach ($replace as $key => $value) {
            $results[$key] = $callback($value, $key);
        }

        asort($results, SORT_REGULAR);

        foreach (array_keys($results) as $key) {
            $results[$key] = $replace[$key];
        }

        return $results;
    }
871733
public static function replaceStrict(array $source, array ...$replace) {

        $replacements = [];

        foreach ($replace as $items) {
            $replacements[] = array_intersect_key($items, $source);
        }

        return array_merge($source, ...$replacements);

    }
344455
public function get($key, array $replace = [])
    {
        return $this->translator->get($this->composeKey($key), $replace, $this->locale);
    }
660437
public static function replace($match, $replace, $org)
    {
        //if $match satisfies regular expression
        if (is::regex($match)) {
            return preg_replace($match, $replace, $org);
        } else {
            return str_replace($match, $replace, $org);
        }
    }