question: protected static String c2h ( String camel ) { StringBuilder b = new StringBuilder ( camel . length ( ) + 5 ) ; for ( int i = 0 ; i < camel . length ( ) ; ++ i ) { char c = camel . charAt ( i ) ; if ( Character . isUpperCase ( c ) ) { if ( i != 0 ) b . append ( '-' ) ; b . append ( Character . toLowerCase ( c ) ) ; } else { b . append ( camel . charAt ( i ) ) ; } } return b . toString ( ) ; }
target:  convert StudlyCaps or camelCase to hyphenated