Stringy\Stringy::camelize PHP Method

camelize() public method

Returns a camelCase version of the string. Trims surrounding spaces, capitalizes letters following digits, spaces, dashes and underscores, and removes spaces, dashes, as well as underscores.
public camelize ( ) : Stringy
return Stringy Object with $str in camelCase
    public function camelize()
    {
        $encoding = $this->encoding;
        $stringy = $this->trim()->lowerCaseFirst();
        $stringy->str = preg_replace('/^[-_]+/', '', $stringy->str);
        $stringy->str = preg_replace_callback('/[-_\\s]+(.)?/u', function ($match) use($encoding) {
            if (isset($match[1])) {
                return \mb_strtoupper($match[1], $encoding);
            }
            return '';
        }, $stringy->str);
        $stringy->str = preg_replace_callback('/[\\d]+(.)?/u', function ($match) use($encoding) {
            return \mb_strtoupper($match[0], $encoding);
        }, $stringy->str);
        return $stringy;
    }