Java HTML Encode htmlEncoder(String content)

Here you can find the source of htmlEncoder(String content)

Description

html Encoder

License

Apache License

Declaration

public static String htmlEncoder(String content) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String htmlEncoder(String content) {
        content = content.replaceAll("\n", "<br>");
        content = content.replaceAll("<", "&lt");
        content = content.replaceAll(">", "&gt");
        content = content.replaceAll(" ", "&nbsp;");
        return content;
    }//from   w  ww.  j a v a 2  s . c om
}

Related

  1. htmlEncode(String strSrc)
  2. htmlEncode(String text)
  3. htmlEncode(String txt)
  4. htmlEncode(String txt)
  5. htmlEncoded(String text)
  6. htmlEncoding(String str)
  7. htmlEntityEncode(String s)
  8. htmlize(CharSequence q)
  9. htmlize(String str)