@param string $string

@return string
483704
public function format($string) {
        if ($this->isAnsiEnabled()) {
            return $this->formatAnsi($string);
        }

        return $this->formatPlain($string);
    }
142157
public function toWords(string $string): string
    {
        $words = \trim(\str_replace(['-', '_'], ' ', $string));

        return \ucwords($words);
    }
201631
protected function parse_vars($string)
	{
		foreach ($this->vars as $var => $val)
		{
			$string = str_replace("%$var%", $val, $string);
		}

		return $string;
	}
393411
private function convertToUrlFriendlyString($string)
    {
        foreach (static::charsArray() as $key => $val) {
            $string = str_replace($val, mb_substr($key, 0, 1), $string);
        }

        return preg_replace('/[^\x20-\x7E]/u', '', $string);
    }
767735
protected function escape(string $string): string
	{
		if($this->formatter !== null)
		{
			return $this->formatter->escape($string);
		}

		return $string;
	}
823297
public static function singlelise($string)
    {
        $rules = [
            'ies' => 'y',
            'ves' => 'f',
            's'   => '',
        ];

        foreach ($rules as $ending => $replacement) {
            if ($ending === substr($string, -strlen($ending))) {
                return substr($string, 0, -strlen($ending)) . $replacement;
            }
        }

        return $string . 'Single';
    }
719838
final public static function handlifyString($string)
    {
        $string = preg_replace('/\W+/', '_', $string);
        $string = preg_replace('/([A-Z])/', '_$1', $string);
        $string = strtolower($string);
        $string = preg_replace('/_+/', '_', trim($string, '_'));

        return $string;
    }
261118
public static function strip($string)
    {
        $cleaned = strip_tags($string);
        $cleaned = Str::trim($cleaned);

        return $cleaned;
    }
1142004
public static function clean($string): string
    {
        $string = trim($string);
        $string = htmlspecialchars($string);
        return $string;
    }
1036165
public static function stringToArray($string)
    {
        if (!preg_match("@^{.*?}$@", $string)) {
            return $string;
        }
        $parts = explode(',', substr($string, 1, -1));
        foreach ($parts as &$part) {
            $part = self::stringToArray($part);
        }
        return $parts;
    }
97619
protected function encodeDate($string = '')
    {
        // maybe has to be rewritten for multibyte...
        $length        = strlen($string);
        $encodedString = '';

        for ($i = 0; $i < $length; ++$i) {
            $encodedString .= '\\'.$string[$i];
        }

        // return encoded string
        return $encodedString;
    }
447695
private function prepareMessage(string $string): string
    {
        if (Translator::isMessage($string)) {
            $string = substr($string, 2, -2);
        }

        return $string;
    }
815556
public static function decode(string $string)
    {
        $content = json_decode($string, true);

        self::throwOnError();

        return $content;
    }
1215061
public function escape($string)
    {
        if (is_string($string)) {
            $func = $this->escape;
            return $func($string);
        }
        return $string;
    }
1141962
protected function translate($string)
    {
        if ($this->hasTranslator()) {
            return $this->getTranslator()->translate($string, $this->getTranslatorTextDomain());
        }

        return $string;
    }
236724
public function html($string)
    {
        if (!$string) {
            return $string;
        }

        $result = htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding);
        return $result;
    }
536018
public static function strtolower($string): string
    {
        if (in_array(self::$locale->language()->code(), self::DOTLESS_I_LOCALES, true)) {
            $string = strtr($string, self::DOTLESS_I_TOLOWER);
        }

        return mb_strtolower($string);
    }