@param string $string

@return string
345384
public function lcFirst($string)
    {
        $first = $this->sub($string, 0, 1);
        $first = $this->low($first);

        return $first . $this->sub($string, 1);
    }
225285
public static function underscore( $string ) {

        if ( !preg_match( '/[A-Z-]|::/' , $string ) ) return $string;

        $string = strtr( $string , [ '::' => '/' , '-' => '_' ] );

        $string = preg_replace( '/([A-Z\d]+)([A-Z][a-z])/' , '$1_$2' , $string );

        $string = preg_replace( '/([a-z\d])([A-Z])/' , '$1_$2' , $string );

        return strtolower( $string );

    }
1229388
public static function variable(string $string): string
	{
		$result = static::_cache(__FUNCTION__, $string);

		if ($result === false) {
			$camelized = static::camelize(static::underscore($string));
			$replace = \strtolower($camelized[0]);
			$result = $replace . \substr($camelized, 1);
			static::_cache(__FUNCTION__, $string, $result);
		}

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

        self::throwOnError();

        return $content;
    }
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;
    }
678099
public function getClassName($string) {
        if (is_string($string) && $strArray= explode('_', $string)) {
            $return= '';
            foreach ($strArray as $k => $v) {
                $return.= strtoupper(substr($v, 0, 1)) . substr($v, 1) . '';
            }
            $string= $return;
        }
        return trim($string);
    }
151788
public function escape_string($string)
    {
        if (!$this->connection) {
            return $string;
        }

        if ($string === null) {
            return $string;
        }
        return $this->connection->escape_string($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;
    }
1141962
protected function translate($string)
    {
        if ($this->hasTranslator()) {
            return $this->getTranslator()->translate($string, $this->getTranslatorTextDomain());
        }

        return $string;
    }
574178
public function convert(string $string): string
    {
        if ($this->encoding === null) {
            $this->encoding = $this->getEncoding($string);
        }

        if ($this->encoding === self::UTF16BE) {
            $string = mb_convert_encoding($string, "UTF-8", "UTF-16BE");
        }

        if ($this->encoding === self::UTF16LE) {
            $string = mb_convert_encoding($string, "UTF-8", "UTF-16LE");
        }

        return $string;
    }
8269
public static function up($string): string
    {
        $cleaned = Str::up($string);
        $cleaned = Str::trim($cleaned);

        return $cleaned;
    }
171033
public static function low($string): string
    {
        $cleaned = Str::low($string);
        $cleaned = Str::trim($cleaned);

        return $cleaned;
    }
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>';
        }
    }
8348
public function getString($string)
    {
        // Exact match?
        if (isset($this->strings[$string])) {
            return $this->strings[$string];
        } else {
            return $string;
        }
    }
1163857
protected function trim(string $string): string
    {
        $string = preg_replace('#\s*\{\{\{\~\s*#is', '{{{', $string);
        $string = preg_replace('#\s*\~\}\}\}\s*#is', '}}}', $string);
        $string = preg_replace('#\s*\{\{\~\s*#is', '{{', $string);
        $string = preg_replace('#\s*\~\}\}\s*#is', '}}', $string);
        return $string;
    }
67019
public static function decode($string)
    {
        return ($string === self::NULL) ? null : strtr($string, self::$decodeMap);
    }
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';
    }