public static String upperFirst(CharSequence s) {
        if (null == s)
            return null;
        int len = s.length();
        if (len == 0)
            return "";
        char c = s.charAt(0);
        if (Character.isUpperCase(c))
            return s.toString();
        return new StringBuilder(len).append(Character.toUpperCase(c))
                                     .append(s.subSequence(1, len))
                                     .toString();
    }
public static String upperFirst(CharSequence s) {
        if (null == s)
            return null;
        int len = s.length();
        if (len == 0)
            return "";
        char c = s.charAt(0);
        if (Character.isUpperCase(c))
            return s.toString();
        return new StringBuilder(len).append(Character.toUpperCase(c))
                                     .append(s.subSequence(1, len))
                                     .toString();
    }
public static String upperFirst ( CharSequence s ) { if ( null == s ) return null ; int len = s . length ( ) ; if ( len == 0 ) return "" ; char c = s . charAt ( 0 ) ; if ( Character . isUpperCase ( c ) ) return s . toString ( ) ; return new StringBuilder ( len ) . append ( Character . toUpperCase ( c ) ) . append ( s . subSequence ( 1 , len ) ) . toString ( ) ; }
将字符串首字母大写

@param s
字符串
@return 首字母大写后的新字符串
将字符串首字母大写