public static String normalizeTextValue ( final String theString ) { if ( null != theString && theString . length ( ) > 0 ) { return theString . replaceAll ( "[\\s\\n]+" , " " ) . trim ( ) ; } return theString ; }
Method equals to the normalize - space xslt function