把字符串第一个字母大写

效率高的:

private static String getMethodName(String fildeName){
    byte[] items = fildeName.getBytes();
    items[0] = (byte)((char)items[0]-'a'+'A');;
    return new String(items);
}

你可能感兴趣的:(第一个字母大写)