@param string $string
@param bool   $translit
@param int    $case

@return string
776668
public static function friendlyUrl($string, $translit = true, $case = self::SNAKE_CASE)
    {
        $data = static::low($string);

        if ($translit)
        {
            $data = static::translit($data);
        }

        $data = \preg_replace('~[^a-zа-яё0-9]+~u', '-', $data);

        if ($case !== self::SNAKE_CASE)
        {
            $data = static::camelCase($data, '-');
        }

        $data = \preg_replace('~-{2,}~', '-', $data);

        return \trim($data, '-');
    }
1243717
public function remove(string $string, bool $caseSensitive = true) : Manipulator
    {
        return new static($this->replace($string, '', $caseSensitive)->toString());
    }
1106974
public static function PROPERCASE($mixedCaseString)
    {
        $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString);

        if (is_bool($mixedCaseString)) {
            $mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
        }

        return PHPExcel_Shared_String::StrToTitle($mixedCaseString);
    }
521623
public static function convertCase(string $string, int $convention): string
    {
        $patterns = [
            '#([a-z])([A-Z])#',
            '#([A-Z]+)([A-Z][a-z])#',
            '#([a-z])([0-9])#i',
            '#([0-9])([a-z])#i',
        ];
        $string = preg_replace($patterns, '$1 $2', $string);
        $string = preg_replace('#[^a-z0-9]+#i', ' ', $string);
        $string = trim($string);

        if ($convention & 0b10000) {
            $string = strtoupper($string);
        } else {
            $string = strtolower($string);
        }

        if ($convention & 0b100) {
            $string = ucwords($string);
        }

        if ($convention & 0b10) {
            $replace = $convention & 0b1 ? '-' : '_';
        } else {
            $replace = '';
        }

        $string = str_replace(' ', $replace, $string);

        if ($convention & 0b1000) {
            $string = lcfirst($string);
        }

        return $string;
    }
404716
protected function fetchCssPseudoContainsSelector($string, $caseSensitive = false)
    {
        if ($caseSensitive) {
            return sprintf('text() = "%s"', $string);
        }

        if (function_exists('mb_strtolower')) {
            return sprintf(
                'php:functionString("mb_strtolower", .) = php:functionString("mb_strtolower", "%s")',
                $string
            );
        } else {
            return sprintf('php:functionString("strtolower", .) = php:functionString("strtolower", "%s")', $string);
        }
    }
348285
public static function transliterateString($string, $safe_mode = false)
    {
        $string = (string) $string;

        if ($safe_mode === true) {
            $string = \str_replace(
                static::$cyr_chars,
                static::$latin_safe_analogs,
                $string
            );
        }

        return Str::ascii($string);
    }
849890
public static function toCamelCase($string) {
		static $canUse = null;
		if (is_null($canUse)) {
			$canUse = method_exists(Strings::class, 'firstLower'); // Nette/Utils >= 2.3 only
		}
		$pascal = self::toPascalCase($string);
		return $canUse
			? Strings::firstLower($pascal)
			: Strings::lower(Strings::substring($pascal, 0, 1)) . Strings::substring($pascal, 1);
	}
101592
public static String transliterate(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        String result = value;
        Set<Map.Entry<String, List<String>>> entries = Ascii.ascii.entrySet();
        for (Map.Entry<String, List<String>> entry : entries) {
            for (String ch : entry.getValue()) {
                result = result.replace(ch, entry.getKey());
            }
        }
        return result;
    }
42763
private function slugify($string, $replacement = '-', $lowercase = true)
    {
        $transliterateOptions = $this->transliterateOptions !== null ? $this->transliterateOptions : 'Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFKC;';
        return (new Slugifier($transliterateOptions, $replacement, $lowercase))->slugify($string);
    }
908385
public static function CaseEqual ($string1, $string2, $encoding = Encoding::DEFAULT_ENCODING) {
		return (self::CaseCompare($string1, $string2, $encoding) === 0);
	}
734089
public static function changeKeyCase($data, int $case = null)
    {
        $properties = get_object_vars($data);
        foreach ($properties as &$key) {
            $value = & $data->$key;
            unset($data->$key);
            
            $changeCaseKey = ($case == CASE_UPPER) ? strtoupper($key) : strtolower($key);
            $data->$changeCaseKey = & $value;
        }
        
        return $data;
    }
472930
public static function slugify($string = '')
    {
        $string = preg_replace('~[^\\pL\d]+~u', '-', $string); 
        if (function_exists('iconv')) {
            $string = iconv('utf-8', 'us-ascii//TRANSLIT', $string);
        } 
        $string = preg_replace('~[^-\w]+~', '', strtolower(trim($string, '-')));
        return $string;
    }
325662
public function toCamelCase(string $string): string
    {
        $words = \str_replace(['-', '_'], ' ', $string);

        $words = \str_replace(' ', '', \ucwords($words));

        return \lcfirst($words);
    }
423700
public static function nameCase($string = '', array $options = [])
    {
        if ($string == '') return $string;

        self::$options = array_merge(self::$options, $options);

        // Do not do anything if string is mixed and lazy option is true.
        if (self::$options['lazy'] && self::skipMixed($string)) return $string;

        // Capitalize
        $string = self::capitalize($string);
        $string = self::updateIrish($string);

        // Fixes for "son (daughter) of" etc
        foreach (self::$replacements as $pattern => $replacement) {
            $string = mb_ereg_replace($pattern, $replacement, $string);
        }

        $string = self::updateRoman($string);
        $string = self::fixConjunction($string);

        return $string;
    }
886557
public static String translit(String s) {
        if (s==null) return "";
        StringBuilder sb=new StringBuilder(s.length()+100);
        final int length=s.length();
        final int translitTableLength=translitTable.length();

        for (int i=0; i<length; i++) {
            char ch=s.charAt(i);
            //System.err.println("ch="+(int)ch);

            if ((ch>='\ufffd' && ch<='\ufffd') || (ch>='\ufffd' && ch<='\ufffd') ||
                ch=='\ufffd' || ch=='\ufffd') {
                int idx=translitTable.indexOf(ch);
                char c;
                if (idx>=0) {
                    for (idx++; idx<translitTableLength; idx++) {
                        c=translitTable.charAt(idx);
                        if ((c>='\ufffd' && c<='\ufffd') || (c>='\ufffd' && c<='\ufffd') ||
                            c=='\ufffd' || c=='\ufffd') break;
                        sb.append(c);
                    }
                }
            }
            else {
                sb.append(ch);
            }
        }
        return sb.toString();
    }
596343
public static function toCamelcase($string, $capitalizeFirstCharacter = false) {

		if(false === is_string($string)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($string)), E_USER_ERROR);
		}

		if(false === is_bool($capitalizeFirstCharacter)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($capitalizeFirstCharacter)), E_USER_ERROR);
		}

	    $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $string)));

	    if(false === $capitalizeFirstCharacter) {
	        $str[0] = strtolower($str[0]);
	    }

	    return $str;
	}
1330425
public function convCaseFirst($charset, $string, $case) {
		$firstChar = $this->substr($charset, $string, 0, 1);
		$firstChar = $this->conv_case($charset, $firstChar, $case);
		$remainder = $this->substr($charset, $string, 1);
		return $firstChar . $remainder;
	}