@param null $string

@return string
973185
public static function underscore($string = null)
    {
        return implode(static::SEPARATOR_UNDERSCORE, array_map(function ($word) {
            return strtolower($word);
        }, preg_split('/([A-Z]*[^A-Z]+)/', static::clear($string), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)));
    }
1262734
public function toString($indent = null)
    {
        $helperManager = $this->getView()->getHelperPluginManager();
        if ($helperManager->has('dojo')) {
            $dojo = $helperManager->get('dojo');
            $dojo->initialize();
        }
        return parent::toString($indent);
    }
56965
public function generateFromString(string $string)
    {
        $badge = Badge::fromString($string);

        return $this->getRendererForFormat($badge->getFormat())->render($badge);
    }
705866
public static function at($string, $num)
    {
        $num = (int) $num;

        if (Utf8String::strlen($string) < $num) {
            return null;
        }

        return Utf8String::substr($string, $num, 1);
    }
236679
public function decrypt($string, $key = null)
    {
        if (null === $key) {
            $key = $this->getEncryptKey();
        }

        $cipherText = base64_decode($string);
        $ivSize     = $this->getMsCryptIvSize();

        $ivDec = substr($cipherText, 0, $ivSize);

        $cipherText = substr($cipherText, $ivSize);

        return mcrypt_decrypt(
            $this->getMcryptCipher(),
            $key,
            $cipherText,
            $this->getMcryptMode(),
            $ivDec
        );
    }
4397
public function get($string = null, $range = '') {
        if($range) {
            $value = isset($this->range[$range][$string]) ? $this->range[$range][$string] : $string;
        }
        else {
            $value = isset($this->lang[$string]) ? $this->lang[$string] : $string;
        }

        return $value;
    }
1263670
public static function mailto(string $string = null): string
    {
        return ($string ? '<a href="mailto:' . str_replace('@', '%40', $string) . '">' . str_replace('@', '&#064;', $string) . '</a>' : '');
    }
953479
public function hash($string, $key = null)
    {

        $publicKey = is_null($key) ? $this->generateKey($string) : $key;

        //echo $publicKey;
        $hashKey1 = sha1($string . $publicKey);
        $hashKey2 = md5($hashKey1);
        $hashKey3 = hash('sha224', $hashKey2);

        return $hashKey3 . ":" . $publicKey;
    }
492166
public function get($string = null, $range = '') {
        if($range) {
            $lang = isset($this->range[$range]) ? $this->range[$range] : [];
        }
        else {
            $lang = $this->lang;
        }

        foreach ($lang as $lg) {
            $count = 0;
            $string = $lg->translate($string, $count);
            if (-1 != $count) {
                break;
            }
        }

        return $string;
    }
835991
public static function likeEmpty(?string $string = null): bool
    {
        return $string === null || $string === '' || $string === false;
    }
935695
public function replaceTokens($string)
    {
        foreach ($this->getTokenNames($string) as $token) {
            $string = str_replace("{{$token}}", $this->getTokenValue($token), $string);
        }
        
        return $string;
    }
1043970
public function urlize(string $string) : string
    {
        // Remove all non url friendly characters with the unaccent function
        $unaccented = $this->unaccent($string);

        if (function_exists('mb_strtolower')) {
            $lowered = mb_strtolower($unaccented);
        } else {
            $lowered = strtolower($unaccented);
        }

        $replacements = [
            '/\W/' => ' ',
            '/([A-Z]+)([A-Z][a-z])/' => '\1_\2',
            '/([a-z\d])([A-Z])/' => '\1_\2',
            '/[^A-Z^a-z^0-9^\/]+/' => '-',
        ];

        $urlized = $lowered;

        foreach ($replacements as $pattern => $replacement) {
            $replaced = preg_replace($pattern, $replacement, $urlized);

            if ($replaced === null) {
                throw new RuntimeException(sprintf(
                    'preg_replace returned null for value "%s"',
                    $urlized
                ));
            }

            $urlized = $replaced;
        }

        return trim($urlized, '-');
    }
767735
protected function escape(string $string): string
	{
		if($this->formatter !== null)
		{
			return $this->formatter->escape($string);
		}

		return $string;
	}
353816
public function char($char = null)
    {
        $pos = $this->pos;
        if ( ! is_null($char)) {
            $pos = $char;
        }

        if ( ! isset($this->content[$pos])) {
            return '';
        }

        return $this->content[$pos];
    }
1273398
protected function replaceText($string)
    {
        if (empty($string)) {
            $this->node->parentNode->removeChild($this->node);

            return null;
        }

        $newElement = $this->node->ownerDocument->createTextNode($string);

        $newNode = $this->node->ownerDocument->importNode($newElement, true);

        $this->node->parentNode->replaceChild($newNode, $this->node);
        $this->node = $newNode;

        return $this;
    }
361571
public function escapeString($s, $EMPTY_NULL = false) {
		if ((!is_string($s)) && (!is_numeric($s))) {
			$s = '';
		}
		if (($EMPTY_NULL) && (empty($s))) {
			return 'NULL';
		}
		return '"' . $this->mysqli->real_escape_string($s) . '"';
	}
499451
public function parse( $string ) {
        $data = parse_url( $string );
        
        //helper function gets $a[$k], checks if exists
        function get( $a, $k ) {
            if( array_key_exists( $k, $a ) ) {
                return empty( $a[$k] ) ? null : $a[$k];
            }
            
            return null;
        }
        
        if( $data === null ) {
            return null;
        }
        
        $uri = new Uri;
        
        $uri->setProtocol( get( $data, 'scheme' ) );
        $uri->setUsername( get( $data, 'user' ) );
        $uri->setPassword( get( $data, 'pass' ) );
        $uri->setHost( get( $data, 'host' ) );
        $uri->setPort( get( $data, 'port' ) );
        $uri->setPath( get( $data, 'path' ) );
        $uri->setQuery( get( $data, 'query' ) );
        $uri->setAnchor( get( $data, 'anchor' ) );
        
        return $uri;
    }