/**
* 首字母大写
* @param str String 要修改的字符串
* @return String 首字母大写的字符串
*/
public String capUpper(String str)
{
if (str == null || "".equals(str))
return "";
if (str.length() == 1)
return str.toUpperCase();
String temp = str.substring(0, 1).toUpperCase()
.concat(str.substring(1).toLowerCase());
return temp;
}
// 把一个字符串的第一个字母大写、效率高
private static String getMethodName(String fildeName) throws Exception
{
byte[] items = fildeName.getBytes();
items[0] = (byte) ((char) items[0] - 'a' + 'A');
return new String(items);
}