@name ucfirst
@kind function

@description
upper case first char
192110
function ucfirst(input) {
  return isString(input) ? input.split(' ')
    .map(function (char) {
      return char.charAt(0).toUpperCase() + char.substring(1);
    }).join(' ') : input;
}
988123
public function getName($ucfirst = false)
    {
        $value = $this->camelCase($this->name);
        if (true === $ucfirst) {
            return ucfirst($value);
        } else {
            return $value;
        }
    }
1149862
private static function formatter(string $name, bool $firstUpper = true): string
    {
        // 将表名中的下划线转换为大写字母
        $words = explode('_', $name);
        foreach ($words as $k => $w) {
            $words [$k] = ucfirst($w);
        }

        // 合并
        $name = implode('', $words);

        // 如果明确要求首字母小写
        if (!$firstUpper) {
            $name = lcfirst($name);
        }

        // 返回名字
        return $name;
    }
582728
public function caseFirstUpper()
    {
        $string = clone $this;
        $string->subString(0, 1)->caseUpper()->val();
        $this->subString(1, $this->length() - 1)->caseLower();

        $this->val($string . $this->val());

        return $this;
    }
131902
function createCaseFirst(methodName) {
      return function(string) {
        string = toString(string);

        var strSymbols = hasUnicode(string)
          ? stringToArray(string)
          : undefined$1;

        var chr = strSymbols
          ? strSymbols[0]
          : string.charAt(0);

        var trailing = strSymbols
          ? castSlice(strSymbols, 1).join('')
          : string.slice(1);

        return chr[methodName]() + trailing;
      };
    }
1071024
private static function mb_ucfirst( $str ) {
		if ( ! is_string( $str ) || '' === $str) { return ''; }
		$first = mb_strtoupper( mb_substr( $str, 0, 1 ) );
		if ( 1 === mb_strlen( $str ) ) { return $first; }
		return $first . mb_substr( $str, 1 );
	}
1321235
public static char getFirstToUpper(String string, char chDefault)
    {
        if ((string != null) && (string.length() > 0))
            chDefault = Character.toUpperCase(string.charAt(0));
        return chDefault;
    }
2800
public static function toCamelCase($str, $upperFirstChar = false)
    {
        $str = self::strtolower($str);

        if ($upperFirstChar) {
            $str = self::ucfirst($str);
        }

        return preg_replace_callback('/_+([a-z])/', function ($c) {
            return strtoupper($c[1]);
        }, $str);
    }
606991
public static function uppercase($string = false, $selector = false) {

        if ($string) {

            switch ($selector) {
                case 'first':
                    return ucfirst($string);
                case 'words':
                    return ucwords($string);
                default:
                    return strtoupper($string);
            }
        }

        return false;
    }
888406
static public function underscoredToCamelcased($str, $ucfirst = false) {
        if ($ucfirst) {
            $str = ucfirst($str);
        }
        $func = f\compose('strtoupper', f\prop(1));
        return preg_replace_callback('/_([a-z])/', $func, $str);
    }
1363508
public static String lowCaseFirst(String s) {
    if (s == null || s.length() == 0) return (s);
    return (Character.toLowerCase(s.charAt(0)) + s.substring(1));
  }
1188298
public static String lowerCaseFirstChar(String s) {
        if (s.isEmpty()) {
            return s;
        }

        char first = s.charAt(0);
        if (isLowerCase(first)) {
            return s;
        }

        return toLowerCase(first) + s.substring(1);
    }
288556
public function toCamelCase($var, $upperFirst = false)
    {
        $v = '' . $var;
        $le = strlen($v);
        if (!$le) {
            return '';
        }
        $arr = preg_split('/[_\- ]/', $v);
        for ($i = 0; $i < $le; ++$i) {
            if ($i || $upperFirst) {
                $arr[$i] = ucfirst($arr[$i]{0}) . substr($arr[$i], 1);
            }
        }
        return join($arr);
    }
133544
public static String getFirstUpperName(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        String firstChar = name.substring(0, 1).toUpperCase();
        return firstChar + name.substring(1);
    }
1105408
public static function mb_ucfirst($str, $encoding = 'UTF-8')
    {
        $length = mb_strlen($str, $encoding);
        $firstChar = mb_substr($str, 0, 1, $encoding);
        $then = mb_substr($str, 1, $length - 1, $encoding);

        return mb_strtoupper($firstChar, $encoding) . $then;
    }
344540
public function getName($ucfirst = false)
    {
        $name = $this->name;

        if (strrchr($name, '\\') !== false) {
            $name = str_replace('\\', '', strrchr($name, '\\'));
        }
        $name = $this->camelCase($name);
        if (true === $ucfirst) {
            return ucfirst($name);
        } else {
            return $name;
        }
    }
421882
public static function ucFirst($input): string
    {
        $string = Str::low($input);
        $string = ucfirst($string);

        return $string;
    }