文本转换为HTML文字编码
来源:互联网 发布:淘宝开店铺要多少钱 编辑:程序博客网 时间:2024/05/17 20:30
/**
* 转换为HTML文字编码.<br>
*/
public static String htmlTextEncoder(String src) throws Exception
{
if (src == null||src.equals(""))
{
return "";
}
String dst = src;
dst = dst.replaceAll("<","<");
dst = dst.replaceAll(">","&rt;");
dst = dst.replaceAll("/"",""");
dst = dst.replaceAll("'","'");
dst = dst.replaceAll(" ", " ");
dst = dst.replaceAll("/r/n", "<br>");
dst = dst.replaceAll("/r", "<br>");
dst = dst.replaceAll("/n", "<br>");
return dst;
}
* 转换为HTML文字编码.<br>
*/
public static String htmlTextEncoder(String src) throws Exception
{
if (src == null||src.equals(""))
{
return "";
}
String dst = src;
dst = dst.replaceAll("<","<");
dst = dst.replaceAll(">","&rt;");
dst = dst.replaceAll("/"",""");
dst = dst.replaceAll("'","'");
dst = dst.replaceAll(" ", " ");
dst = dst.replaceAll("/r/n", "<br>");
dst = dst.replaceAll("/r", "<br>");
dst = dst.replaceAll("/n", "<br>");
return dst;
}
- 文本转换为HTML文字编码
- 文本添加格式转换为html类!
- PHP html 转换为纯文本
- js将html转换为纯文本
- php转换html格式为文本格式
- LR实现普通文字转换为URL格式编码
- 文字转换为二进制/十六进制(Uncode编码 java实现)
- linux 批量转换文本编码为UTF-8
- 使用正则表达式将Html转换为纯文本
- 使用正则表达式将Html转换为纯文本
- 使用正则表达式将Html转换为纯文本
- 如何将HTML转换为纯文本格式Text
- JAVA 过滤标签将html内容转换为文本
- txt 转换为 html 解析文本 自动打上标签
- JAVA 过滤标签将html内容转换为文本
- 使用C#将HTML文本转换为普通文本,去掉所有的Html标记
- 使用C#将HTML文本转换为普通文本,去掉所有的Html标记
- C#将HTML文本转换为普通文本,去掉所有的Html标记
- 学习.Net的经典网站
- 人生
- LAN91C111 开发手记
- Javascript中最常用的55个经典技巧
- 学习日语的网站
- 文本转换为HTML文字编码
- 学习SQL2005当中的例子
- 一些报名网站上传照片大小的问题
- 12球问题
- I2C总线
- ASP.NET中数据访问层自动生成的一些工具
- 到友谊宾馆烧钱
- sql 语句实现简单查询和复杂查询
- NHibernate快速指南