Escapes style tags if we have a formatter.

@param  string $string string
@return string
767735
protected function escape(string $string): string
	{
		if($this->formatter !== null)
		{
			return $this->formatter->escape($string);
		}

		return $string;
	}
1250144
private String escapeSpecialCharacters(final String string) {
		final StringBuilder escaped = new StringBuilder();
		for (final char character : string.toCharArray()) {
			if (character == '%' || character == '_' || character == '\\') {
				escaped.append('\\');
			}
			escaped.append(character);
		}
		return escaped.toString();
	}
236724
public function html($string)
    {
        if (!$string) {
            return $string;
        }

        $result = htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding);
        return $result;
    }
1003954
protected function escape($string)
    {
        if (preg_match('/["\s,]/', $string) === false) {
            return addslashes($string);
        } else {
            return sprintf('"%s"', addcslashes($string, '"\\'));
        }
    }
199964
protected function escape(string $string): string
    {
        return htmlspecialchars($string, ENT_QUOTES | ENT_IGNORE, $this->encoding);
    }
812177
private function underscore($string)
    {
        $string = preg_replace('/(?<=[a-z])([A-Z])/', '_$1', $string);

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

        return strtolower($string);
    }
970219
public function EscapeString($String) {
      $Array = FALSE;
      if (substr($String, -2) == '[]') {
         $String = substr($String, 0, -2);
         $Array = TRUE;
      }
      $Return = urlencode(str_replace(' ', '_', $String));
      if ($Array === TRUE) $Return .= '[]';

      return str_replace('.', '-dot-', $Return);
   }
1222719
public function escape($string) {
    if(get_magic_quotes_runtime()) {
      $string = stripslashes($string);
    }

    if(function_exists($this->db->)) {
      return $this->db->($string);
    } elseif(function_exists($this->db->quote)) {
      return $this->db->quote($string);
    } else {
      return $string;
    }
  }
959065
protected function replace($string)
    {
        foreach ($this->patterns as $key => $value) {
            $string = str_replace($key, $value, $string);
        }

        return $string;
    }
688728
public static function slugify($string) {
        $string = strip_tags($string);
        $string = str_replace(['&amp;', '&'], 'and', $string);
        $string = str_replace('@', 'at', $string);

        // @codeCoverageIgnoreStart
        if (class_exists('Titon\G11n\Utility\Inflector')) {
            return \Titon\G11n\Utility\Inflector::slug($string);
        }
        // @codeCoverageIgnoreEnd

        return Inflector::slug($string);
    }
1279024
private static function capsCase(string $string): string
    {
        $output = [];

        if (preg_match('/\A[a-z0-9]+\z/i', $string) && strtoupper($string) !== $string) {
            $parts = self::explodeOnCaps($string);
        } else {
            $parts = self::explodeOnDelims($string);
        }

        foreach ($parts as $part) {
            $output[] = ucfirst(strtolower($part));
        }

        return implode('', $output);
    }
564033
function escape (string) {
  return string
    .replace(/ /g, '\\ ')
    .replace(/\n/g, '')
    .replace(/\(/g, '\\(')
    .replace(/\)/g, '\\)');
}
447745
public function escapeLikeWildcards(string $string): string
    {
        return ($this->grammar ?? $this->database->getGrammar())->escapeLikeWildcards($string);
    }
1374154
protected function escapeLike($string)
    {
        $escapedString = addcslashes($string, '\'\\');
        $replace = [
            '\\\\%' => '\\%',
            '\\\\_' => '\\_',
        ];
        $escapedString = str_replace(array_keys($replace), array_values($replace), $escapedString);
        return "'" . $escapedString . "'";
    }
1154315
public static function escape($string, $flag = ENT_COMPAT, $hardEscape = true)
    {
        return htmlspecialchars($string, $flag, static::ENCODING, (bool) $hardEscape);
    }
1180613
private function formatStringAsTextBlock($string)
    {
        if (!is_string($string)) {
            return '';
        }

        $string = wordwrap($string, $this->maxLineLength - $this->prefixLength);

        $stringLines = explode(PHP_EOL, $string);
        foreach ($stringLines as &$line) {
            $line = str_repeat(' ', $this->prefixLength).$line;
        }

        $string = implode(PHP_EOL, $stringLines);

        // needed to remove the unnecessary prefix added to the first line
        $string = trim($string);

        return $string;
    }
15862
public static function studlyCase($string) {
    $string = Strings::capitalize(Strings::replace($string, ['/-/', '/_/'], ' '));
    return Strings::replace($string, '/ /');
  }