private String filterWhitespace ( String text ) { text = text . replace ( "\n" , " " ) ; text = text . replaceAll ( " {2,}" , " " ) ; text = XmlEscape . escape ( text ) ; return text . trim ( ) ; }
This method filters out white space characters