public static String singleSpaceString ( String value ) { Assert . hasText ( value , "String value must contain text" ) ; return trim ( concat ( value . split ( "\\s+" ) , SINGLE_SPACE ) ) ; }
Single spaces the tokens in the specified String value . A token is defined as any non - whitespace character .