public static String hyphenCaseToCamelCase ( String s ) { List < String > words = Stream . of ( s . split ( "-" ) ) . filter ( w -> ! "" . equals ( w ) ) . collect ( Collectors . toList ( ) ) ; if ( words . size ( ) < 2 ) { return s ; } StringBuilder parsedString = new StringBuilder ( words . get ( 0 ) ) ; for ( int i = 1 ; i < words . size ( ) ; i ++ ) { parsedString . append ( Character . toUpperCase ( words . get ( i ) . charAt ( 0 ) ) ) . append ( words . get ( i ) . substring ( 1 ) ) ; } return parsedString . toString ( ) ; }
Parse lower hyphen case to upper camel case .