public static String shrinkSpace ( Object o ) { if ( null == o ) return "" ; return o . toString ( ) . replaceAll ( "[\r\n]+" , "\n" ) . replaceAll ( "[ \\t\\x0B\\f]+" , " " ) ; }
Shrink spaces in an object s string representation by merge multiple spaces tabs into one space and multiple line breaks into one line break