Java String Quote quoteHtml(final String s)

Here you can find the source of quoteHtml(final String s)

Description

quote Html

License

Open Source License

Declaration

static public String quoteHtml(final String s) 

Method Source Code

//package com.java2s;

public class Main {
    static public String quoteHtml(final String s) {
        String res = s.replace("&", "&");
        res = res.replace("<", "&lt;");
        res = res.replace(">", "&gt;");
        res = res.replace("\n", "<br>");

        return res;
    }/*from   ww  w. j  a  va  2  s.  c  o  m*/
}

Related

  1. quoteForHTML(String toQuote)
  2. quoteForMdx(StringBuilder buf, String val)
  3. quoteForRegEx(String input)
  4. quoteForXML(String from)
  5. quoteHost(final String hostname)
  6. quoteHtml(String s)
  7. quoteHTML(String string)
  8. quoteHtmlContent(String x)
  9. quoteIdentifier(String identifier)