@param string $string

@return string
970443
protected function sanitizeAccount($string)
    {
        static $crudeReplacements = [
            '.' => '',
            ' ' => '',
            'GIRO' => 'P',
        ];

        // crude IBAN to 'old' converter
        if (Mt940::$removeIBAN
            && preg_match('#[A-Z]{2}[\d]{2}[A-Z]{4}(.*)#', $string, $results)
            && !empty($results[1])
        ) {
            $string = $results[1];
        }

        $account = ltrim(
            str_replace(
                array_keys($crudeReplacements),
                $crudeReplacements,
                strip_tags(trim($string))
            ),
            '0'
        );
        if ($account !== '' && strlen($account) < 9 && strpos($account, 'P') === false) {
            $account = 'P' . $account;
        }

        return $account;
    }
600766
protected function normalizeChain(string $string): string
    {
        if (null === $this->chain) {
            return $string;
        }

        return $this->chain
                ->normalize($string);
    }
702813
public static function clearString( string $string ) {
		$string = trim( $string );
		$string = stripslashes( $string );
		$string = htmlspecialchars( $string );

		return $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);
   }
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;
    }
1039959
public static function encode($string) 
	{
		$string = base64_encode($string);
		$string = rtrim($string, '=');
		$string = strtr($string, '+/', '-_');
		
		return $string;
	}
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;
    }
414678
public function prepare(string $string): string
    {
        foreach ($this->_steps as $step) {
            $string = $step->apply($string);
        }
        return $string;
    }
773472
public static function safe(string $string) : string
  {
    $split = str_split($string);

    foreach($split as $k => $char) {
      if (str_contains('~!@#$%^&*()_-=+<>/\?;:{}[]|,.', $char)) {
        unset($split[$k]);
      }
    }

    return implode('', $split);
  }
670090
public function replace($string)
    {
        foreach ($this->bag as $key => $value) {
            $string = str_replace($key, $value, $string);
        }

        return $string;
    }
1222934
public static function strtoupper(string $string): string
    {
        return str_replace('ß', 'SS', mb_strtoupper($string, 'UTF-8'));
    }
84030
private static function output($string)
    {
        if (self::is_cli()) {
            return $string."\n";
        } else {
            $string=trim($string);
            if (!self::$use_pre) {
                return $string;
            }

            return '<pre '.self::$pre_attributes.'>' . $string . '</pre>';
        }
    }
496796
private function stringToUsernameChunk($string)
    {
        $string = trim((string) $string);
        $string = preg_replace('/[^a-z0-9]+/', '_', strtolower($string));
        $string = preg_replace('/__+/', '_', $string);
        $string = trim($string, '_');

        return $string;
    }
1141962
protected function translate($string)
    {
        if ($this->hasTranslator()) {
            return $this->getTranslator()->translate($string, $this->getTranslatorTextDomain());
        }

        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;
    }
151788
public function escape_string($string)
    {
        if (!$this->connection) {
            return $string;
        }

        if ($string === null) {
            return $string;
        }
        return $this->connection->escape_string($string);
    }
57164
public function normalize($string) {
		$string = $this->_normalize($string, ['clean' => true, 'case' => true]);
		return implode('-', str_split($string, $this->_partLength));
	}