Interpolate a string.

@param  string $string
@param  string $styleName
@return string
556427
public function interpolate($string, $attachment, $styleName = '')
	{
		foreach ($this->interpolations() as $key => $value)
		{
			if (strpos($string, $key) !== false) {
				$string = preg_replace("/$key\b/", $this->$value($attachment, $styleName), $string);
			}
		}

		return $string;
	}
1035039
public static function idize($string, $capitalize = false)
    {
        $string = mb_strtolower(static::stripDiacritics($string));

        $string = preg_replace('/[^0-9a-zA-Z-]/i', '-', $string);
        $string = preg_replace('/(-+)/i', '-', $string);
        $string = trim($string, '-');

        return $capitalize ? mb_strtoupper($string) : $string;
    }
387187
function(style, stylename)
	{
		if (mxUtils.indexOfStylename(style, stylename) < 0)
		{
			if (style == null)
			{
				style = '';
			}
			else if (style.length > 0 && style.charAt(style.length - 1) != ';')
			{
				style += ';';
			}
			
			style += stylename;
		}
		
		return style;
	}
687259
public function style($style)
    {
        if (is_string($style)) {
            $this->attributes['style'] = $style;

            return $this;
        }

        if (is_array($style)) {

            $html = [];

            foreach ($style as $name => $value) {
                $html[] = "$name:$value";
            }

            $this->attributes['style'] = implode(';', $html);
        }

        return $this;
    }
866192
public function convertToNato($string)
    {
        $natoReturn = array();

        for($i=0; $i < strlen($string); $i++) {
            $currentLetter=substr($string,$i,1);

            if (! empty($this->nato[$currentLetter])) {
                $natoLetter = strtolower($this->nato[$currentLetter]);
            } else if (! empty($this->nato[strtolower($currentLetter)])) {
                $natoLetter = strtoupper($this->nato[strtolower($currentLetter)]);
            } else {
                $natoLetter = $currentLetter;
            }
            $natoReturn[] = $natoLetter;
        }

        return implode(" ",$natoReturn);
    }
284765
public function line($string, $style = null, $verbosity = null)
    {
        $this->output->writeln($string);
    }
581974
function (element, style) {
			var styleString = '';

			for (var key in style) {
				styleString += key + ': ' + style[key] + ';';
			}

			element.setAttribute('style', styleString);

			return element;
		}
531778
public function formatPlain($string) {
        $groups = $this->formatParser->parseFormat($string);

        foreach ($groups as $group) {
            $tag = $group[0];
            $styleName = $group[1];

            if ($styleName === 'style' || $this->hasStyle($styleName)) {
                $string = str_replace($tag, '', $string);
            }
        }

        $string = $this->formatParser->unescapeTags($string);

        return $string;
    }
360897
public static function variablize($string)
    {
        $string = self::camelize(self::underscore($string));
        $result = strtolower(substr($string, 0, 1));
        $variable = preg_replace('/\\w/', $result, $string, 1);
        return $variable;
    }
1095172
private function underscore($string)
    {
        $str = preg_replace('/(?<=[a-z])([A-Z])/', '_$1', $string);

        if ($this->case === CASE_UPPER) {
            return strtoupper($str);
        }

        return strtolower($str);
    }
155172
function interpolateStyle(styles, attr, subattr = '') {
  // Title-case the sub-attribute.
  if (subattr) {
    /* eslint-disable-next-line no-param-reassign */
    subattr = subattr.replace(subattr[0], subattr[0].toUpperCase());
  }

  return ['Top', 'Right', 'Bottom', 'Left']
    .map((dir) => styles[attr + dir + subattr])
    .join(' ');
}
651549
function stylize( $styleName, $text )
    {
        $preStyle = $this->style( $styleName );
        $postStyle = $this->style( $styleName . '-end' );
        return $preStyle . $text . $postStyle;
    }
10671
public function inflect(string $string, $pluralize = 0) : string
    {
        return ($pluralize) ? Inflect::pluralize($string) : Inflect::singularize($string);
    }
1187963
function interpolate(string, object) {
    forOwn(object, function(value, key) {
      // escape regexp special characters in `key`
      string = string.replace(RegExp('#\\{' + key.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1') + '\\}', 'g'), value);
    });
    return string;
  }
541842
private function processStringPlaceholders($string, array $variables)
    {
        foreach ($variables as $key => $value) {
            if (!is_string($value) && !is_numeric($value) && !is_bool($value)) {
                continue;
            }

            $string = str_replace('{'.$key.'}', $value, (string) $string);
        }

        return $string;
    }
343789
function parseStyleText( styleText )
	{
		var retval = {};
		styleText
		   .replace( /&quot;/g, '"' )
		   .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value )
		{
			retval[ name ] = value;
		} );
		return retval;
	}
808197
private function prepareString($string)
    {
        return str_replace(
            array_keys($this->owner->variables),
            array_values($this->owner->variables),
            $string
        );
    }