public static String initCaps(String in) {
        return in.length() < 2 ? in.toUpperCase() : in.substring(0, 1).toUpperCase() + in.substring(1);
    }
public static String initCaps ( String in ) { return in . length ( ) < 2 ? in . toUpperCase ( ) : in . substring ( 0 , 1 ) . toUpperCase ( ) + in . substring ( 1 ) ; }
Converts the first character of the string to uppercase. Does NOT deal with surrogate pairs.