当前位置:开发者网络 >> 技术教程 >> .NET教程 >> 面向对象编程 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
替换HTML代码
作者:未知
日期:2004-10-27
人气:
投稿:snow(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:
将一些HTML替换掉

eg:
strContent=strContent.Replace("&","&amp");
strContent=strContent.Replace("'","''");
strContent=strContent.Replace("<","&lt");
strContent=strContent.Replace(">","&gt");
strContent=strContent.Replace("chr(60)","&lt");
strContent=strContent.Replace("chr(37)","&gt");
strContent=strContent.Replace("\"","&quot");
strContent=strContent.Replace(";",";");
strContent=strContent.Replace("\n","<br/>");
strContent=strContent.Replace(" ","&nbsp");
return strContent;



相关文章: