循环,然后Character.toUpperCase(str.charAt(0));

解决方案 »

  1.   


        public static String[] capitalize(String[] strs) {
            int strsLen;
            if (strs == null || (strsLen = strs.length) == 0) {
                return null;
            }
             
            for(int i=0;i<strs.length;i++)
            {
                strs[i] = new StringBuffer(strsLen)
                            .append(Character.toTitleCase(strs[i].charAt(0)))
                            .append(strs[i].substring(1)).toString();
            }
            return strs;
       }