Here you can find the source of cleanText(final String input)
private static String cleanText(final String input)
//package com.java2s; public class Main { /** Cleans a string for of insignificant whitespace */ private static String cleanText(final String input) { if (input == null) return ""; /* get rid of line breaks */ String retValue = input.replaceAll("\\r\\n|\\r|\\n|\\t", " "); /* get rid of double spaces */ while (retValue.indexOf(" ") != -1) retValue = retValue.replaceAll(" ", " "); return retValue; }/*from w w w .j a v a 2s .c o m*/ }