Java String Clean cleanText(String text)

Here you can find the source of cleanText(String text)

Description

removes some non-standard characters from a string

License

Open Source License

Parameter

Parameter Description
text input text

Return

cleaned text

Declaration

public static String cleanText(String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from   w ww . jav  a  2s.  co  m*/
     * removes some non-standard characters from a string
     * @param text input text
     * @return cleaned text
     */
    public static String cleanText(String text) {
        if (text != null) {
            text = text.replaceAll("&", "&");
            text = text.replaceAll("_", " ");
            text = text.replaceAll("  ", " ");
        }

        return text;
    }
}

Related

  1. cleanText(String s)
  2. cleanText(String s)
  3. cleanText(String t)
  4. cleanText(String text)
  5. cleanText(String text)
  6. cleanText(String text)
  7. cleanText(String text)
  8. cleanTextForCSV(final String input)
  9. toText(String content)