public static String toStudlyCase ( final String value ) { validate ( value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; String [ ] words = collapseWhitespace ( value . trim ( ) ) . split ( "\\s*(_|-|\\s)\\s*" ) ; return Arrays . stream ( words ) . filter ( w -> ! w . trim ( ) . isEmpty ( ) ) . map ( Strman :: upperFirst ) . collect ( joining ( ) ) ; }
Transform to StudlyCaps .