List of utility methods to do HTML Encode
String | toHtml(String s) Returns the specified string converted to a format suitable for HTML. if (s == null) { return null; for (String[] substitution : HTML_SUBSTITUTIONS) { if (s.contains(substitution[0])) { s = s.replaceAll(substitution[0], substitution[1]); return s; |
String | toHtml(String str) to Html if (str == null) return ""; StringBuffer sb = new StringBuffer(); int len = str.length(); for (int i = 0; i < len; i++) { char c = str.charAt(i); switch (c) { case ' ': ... |
String | toHtml(String str) to Html if (str == null) return ""; str = str.replaceAll("&", "&"); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); str = str.replaceAll("\"", """); str = str.replaceAll("\r\n", "\n"); str = str.replaceAll("\n", "<br/>"); ... |
String | toHtml(String str) to Html return str.replace("&", "&").replace("<", "<").replace(">", ">").replace("'", "'") .replace("\"", """).replace("(", "(").replace(")", ")").replace("[", "[") .replace("]", "]").replace("{", "{").replace("|", "|").replace("}", "}") .replace("/", "/").replace(",", ",").replace("\\", "\"); |
String | toHtml(String str) to Html if (str == null) return ""; String html = new String(str); html = toHtmlInput(html); html = html.replaceAll("\r\n", "\n"); html = html.replaceAll("\n", "<br>\n"); html = html.replaceAll("\t", " "); html = html.replaceAll(" ", " "); ... |
String | toHTML(String string) to HTML if (string != null) { string = string.replace("&", "&"); string = string.replace("\"", """); string = string.replace("'", "'"); string = string.replace("<", "<"); string = string.replace(">", ">"); return string; ... |
String | toHTML(String text) Converts a multiline string to an HTML-string that can be displayed in a label. StringBuilder buf = new StringBuilder("<HTML>"); if (text != null) { buf.append(text.replace("\n", "<BR>")); buf.append("</HTML>"); return buf.toString(); |
String | toHtml(String text) to Html text = text.replaceAll("\n", "<br/>"); text = text.replaceAll(" ", " "); return text; |
String | toHtml(String trace) to Html return trace.replaceAll("&", """).replaceAll("<", "<").replaceAll(">", ">") .replaceAll("\"", """).replaceAll("\t", " "); |
String | toHtml(String txt) to Html return txt.replaceAll("\n", "<br>"); |