public static String underScore2CamelCase(String strs) {

        if (strs == null || !strs.contains("_")) {
            return strs;
        }
        StringBuilder sb = new StringBuilder("");
        String[] elems = strs.split("_");
        for (int i = 0; i < elems.length; i++) {
            String elem = elems[i].toLowerCase();
            if (i != 0) {
                char first = elem.toCharArray()[0];
                sb.append((char) (first - 32)).append(elem.substring(1));
            } else {
                sb.append(elem);
            }
        }
        return sb.toString();
    }
public static String underScore2CamelCase ( String strs ) { if ( strs == null || ! strs . contains ( "_" ) ) { return strs ; } StringBuilder sb = new StringBuilder ( "" ) ; String [ ] elems = strs . split ( "_" ) ; for ( int i = 0 ; i < elems . length ; i ++ ) { String elem = elems [ i ] . toLowerCase ( ) ; if ( i != 0 ) { char first = elem . toCharArray ( ) [ 0 ] ; sb . append ( ( char ) ( first - 32 ) ) . append ( elem . substring ( 1 ) ) ; } else { sb . append ( elem ) ; } } return sb . toString ( ) ; }
下划线格式字符串转换成驼峰格式字符串
eg: player_id -> playerId;<br>
player_name -> playerName;