Java Utililty Methods String Clean

List of utility methods to do String Clean

Description

The list of methods to do String Clean are organized into topic(s).

Method

StringcleanText(String text)
clean Text
String result = text.replaceAll("[\"()\n]", " ");
result = result.trim();
result = result.replaceAll("( )+", " ");
return result;
StringcleanTextForCSV(final String input)
clean Text For CSV
if (input == null)
    return "";
return "\"" + input.replaceAll("\"", "\"\"") + "\"";
StringtoText(String content)
Format the content for search results page
if (content == null) {
    return "";
StringBuffer sb = new StringBuffer();
boolean gotSpace = false;
for (int i = 0; i < content.length(); i++) {
    char a = content.charAt(i);
    if (a == '\r' || a == '\n' || a == '\t' || a == ' ') {
...