package Controller; public class TranslationStr { public String HtmltoStr(String newText) { // newText = newText.replace(" ", "<br>"); //textBox里的换行是用 来表示的,如果要在HTML里显示换行要用<br> newText = newText.replace("<", "<"); //置换 < newText = newText.replace(">", ">"); //置换 > newText=newText.replace("/", "&frasl"); return newText; } public String StrtoHtml(String newText) { //newText = newText.replace("<br>", " "); newText = newText.replace("<", "<"); newText = newText.replace(">", ">"); newText=newText.replace("&frasl","/"); return newText; } }
转载于:https://www.cnblogs.com/ZCM98/p/12482400.html