下划线转驼峰命名
private static String formatCamelCase(String str){
if(StringUtils.isBlank(str)){
return str;
}
StringBuilder result = new StringBuilder();
boolean isUp = false;
char[] chars = str.toCharArray();
for(char c:chars){
if(isUp){
//转大写
if (c >= 'a' && c <= 'z') {
c -= 32;
}
isUp=false;
}else{
//转小写
if (c >= 'A' && c <= 'Z') {
c += 32;
}
}
if('_' == c){
isUp = true;
}else{
result.append(c);
}
}
return result.toString();
}