@param string $string

@return string
422639
public function transform($string)
    {
        $string = Normalizer::normalize($string, $this->form);
        if ($string === null) {
            throw new UnexpectedValueException('Normalizer error.');
        }
        return $string;
    }
1307901
public static function txt2Slug(?string $string): string
  {
    if ($string===null) return '';

    return trim(preg_replace('/[^0-9a-z]+/', '-', strtr(mb_strtolower($string), self::$trans)), '-');
  }
224944
private function clean($string) {
	   $string = str_replace(' ', '', $string);
	   $string = str_replace('-', '', $string);
	   return preg_replace('/[^A-Za-z0-9\-]/', '', $string);
	}
574606
public static function variable($string) {
        $string = preg_replace('/[^_a-z0-9]+/i', '', $string);

        if (is_numeric(mb_substr($string, 0, 1))) {
            $string = '_' . $string;
        }

        return $string;
    }
921019
protected function encodeString($string)
    {
        // If no encoding value was passed in...
        if ($this->encoding === null) {
            return $string;
        }

        $detect = mb_detect_encoding($string);

        // If the current encoding is already the requested encoding
        if (is_string($detect) && $detect === $this->encoding) {
            return $string;
        }

        // Failed to determine encoding
        if (is_bool($detect)) {
            return $string;
        }

        // Convert it!
        return mb_convert_encoding($string, $this->encoding, $detect);
    }
1076115
public function parseString($string)
    {

        $stringHelper = $this->container->get('opifer.content.string_helper');

        $string = $stringHelper->replaceLinks($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;
    }
483704
public function format($string) {
        if ($this->isAnsiEnabled()) {
            return $this->formatAnsi($string);
        }

        return $this->formatPlain($string);
    }
896957
static public function strToCamelCase($string)
	{
		$string = self::strToLowerUrl($string, false);

		$string = implode('', array_map('ucfirst', explode('_', $string)));
		$string = implode('', array_map('ucfirst', explode('-', $string)));

		return strtolower(substr($string, 0, 1)) . substr($string, 1);
	}
935695
public function replaceTokens($string)
    {
        foreach ($this->getTokenNames($string) as $token) {
            $string = str_replace("{{$token}}", $this->getTokenValue($token), $string);
        }
        
        return $string;
    }
430372
protected function normalizeString($string)
    {
        if (false === strpos($string, '_')) {
            return $string;
        }

        $offset = strspn($string, '_');
        if ($offset) {
            $underscorePrefix = substr($string, 0, $offset);
            $string = substr($string, $offset);
        } else {
            $underscorePrefix = '';
        }

        return $underscorePrefix.parent::normalizeString($string);
    }
201631
protected function parse_vars($string)
	{
		foreach ($this->vars as $var => $val)
		{
			$string = str_replace("%$var%", $val, $string);
		}

		return $string;
	}
1068252
public function write($string)
    {
        $length = strlen($string);

        $start = substr($this->resource, 0, $this->pointer);
        $end = substr($this->resource, $this->pointer + $length);

        $this->resource = $start . $string . $end;

        $this->pointer = strlen($start . $string);

        return $string;
    }
691213
public static function low($string): string
    {
        if (self::isMBString()) {
            return mb_strtolower($string, self::$encoding);
        }

        return strtolower($string); // @codeCoverageIgnore
    }
57164
public function normalize($string) {
		$string = $this->_normalize($string, ['clean' => true, 'case' => true]);
		return implode('-', str_split($string, $this->_partLength));
	}
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;
    }
844342
public function normalize(string $string) : string
    {
        if (isset($this->cache[$string])) {
            return $this->cache[$string];
        }

        $result = $this->normalizeChain($string);

        $toCache = array_map(function(RuleInterface $rule) use (&$result) {
            return $result = $rule->apply($result);
        }, $this->rules);

        // Add cache for variants
        array_map(function($index) use ($result) {
            $this->cache[$index] = $result;
        }, $toCache);
        $this->cache[$string] = $result;

        return $result;
    }