Java——下划线转驼峰
常常用于数据库字段转为java字段
private static String changeColumn(String column) {
String name = column;
if (name.indexOf("_") > 0 && name.length() != name.indexOf("_") + 1) {
int lengthPlace = name.indexOf("_");
name = name.replaceFirst("_", "");
String s = name.substring(lengthPlace, lengthPlace + 1);
s = s.toUpperCase();
column = name.substring(0, lengthPlace) + s + name.substring(lengthPlace + 1);
} else {
return column;
}
return changeColumn(column);
}