Here you can find the source of toHtml(String str)
public static String toHtml(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String toHtml(String str) { return str.replace("&", "&").replace("<", "<").replace(">", ">").replace("'", "'") .replace("\"", """).replace("(", "(").replace(")", ")").replace("[", "[") .replace("]", "]").replace("{", "{").replace("|", "|").replace("}", "}") .replace("/", "/").replace(",", ",").replace("\\", "\"); }// w w w . j av a 2s . co m }