syncedit.java
来自「他提供是针对特殊HTML字符转换的编辑器.(开发环境JBUILDER2005)」· Java 代码 · 共 27 行
JAVA
27 行
package editor;
public class SyncEdit
{
public static String encode2HTML(String str)
{
if(null == str || "".equals(str.trim())){
return str;
}
else{
String tempHtml = str;
tempHtml = tempHtml.replaceAll("&","&");
tempHtml = tempHtml.replaceAll("<","<");
tempHtml = tempHtml.replaceAll(">",">");
tempHtml = tempHtml.replaceAll("\r\n","\n");
tempHtml = tempHtml.replaceAll("\n","<br>");
tempHtml = tempHtml.replaceAll("\t"," ");
tempHtml = tempHtml.replaceAll(" "," ");
tempHtml = tempHtml.replaceAll("\"",""");
return tempHtml;
}
}
// public static void main(String[] args)
// {
// System.out.println(""+SynchEdit.encode2HTML("<> "));
// }
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?