Java HTML htmlFilter(String value)

Here you can find the source of htmlFilter(String value)

Description

html Filter

License

Open Source License

Declaration

public static String htmlFilter(String value) 

Method Source Code

//package com.java2s;

public class Main {

    public static String htmlFilter(String value) {
        if (value == null || value.length() == 0) {
            return " ";
        }/*from w w w. jav  a2s  .  c  o m*/

        return value.replaceAll("&", "&").replaceAll("\t", "    ").replaceAll(" ", " ")
                .replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;")
                .replaceAll("\n", "<br/>");
    }
}

Related

  1. htmlConvert(String htmlStr)
  2. HTMLEnc(String s)
  3. htmlEnclose(String html)
  4. htmlFilenameForClass(Class c)
  5. HTMLFilter(String the_txt)
  6. htmlFilterToEmpty(String value)
  7. htmlFooter()
  8. htmlFormat(String input)
  9. htmlFormatText(String line1, String line2)