Java HTML Encode toHtmlInput(String str)

Here you can find the source of toHtmlInput(String str)

Description

to Html Input

License

Open Source License

Declaration

public static String toHtmlInput(String str) 

Method Source Code

//package com.java2s;

public class Main {

    public static String toHtmlInput(String str) {
        if (str == null)
            return "";

        String html = new String(str);

        //        html = html.replaceAll("&", "&");
        html = html.replaceAll("<", "&lt;");
        html = html.replaceAll(">", "&gt;");
        //        html = html.replaceAll("\"", "&quot;");

        return html;
    }/*ww  w  . j a v  a 2 s  . c o  m*/
}

Related

  1. toHtmlChars(String htmlReady)
  2. toHTMLContentString(String s, boolean replaceSpaces, boolean isXhtml)
  3. toHtmlCR(String text)
  4. toHTMLEncode(String string)
  5. toHTMLEscapedText(String s)
  6. toHtmlLine(String input)
  7. toHTMLString(String in)
  8. toHtmlString(String input)
  9. toHTMLString(String org)