Here you can find the source of checkHtmlView(String strString)
public static String checkHtmlView(String strString)
//package com.java2s; public class Main { public static String checkHtmlView(String strString) { String strNew = ""; try {/*from w w w . j a v a 2 s. c o m*/ StringBuffer strTxt = new StringBuffer(""); char chrBuff; int len = strString.length(); for (int i = 0; i < len; i++) { chrBuff = (char) strString.charAt(i); switch (chrBuff) { case '<': strTxt.append("<"); break; case '>': strTxt.append(">"); break; case '"': strTxt.append("""); break; case 10: strTxt.append("<br>"); break; case ' ': strTxt.append(" "); break; // case '&' : // strTxt.append("&"); // break; default: strTxt.append(chrBuff); } } strNew = strTxt.toString(); } catch (Exception ex) { return null; } return strNew; } }