vb 去掉html中的回车和tab;转换部分html大写标签为小写
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vb 去掉html中的回车和tab;转换部分html大写标签为小写相关的知识,希望对你有一定的参考价值。
‘//去掉各种回车空格符
Public Function replaceEnter(bStr As String)
bStr = Replace(bStr, " ", "")
bStr = Replace(bStr, vbTab, "")
bStr = Replace(bStr, vbCrLf, "")
bStr = Replace(bStr, Chr(13) + Chr(10), "")
bStr = Replace(bStr, Chr(13), "")
bStr = Replace(bStr, Chr(10), "")
replaceEnter = bStr
End Function
‘//网页标签改为小写
Public Function htmlLableToSmall(strHtml As String)
strHtml = Replace(strHtml, "<A", "<a")
strHtml = Replace(strHtml, "</A", "</a")
strHtml = Replace(strHtml, "<SPAN", "<span")
strHtml = Replace(strHtml, "</SPAN", "</span")
strHtml = Replace(strHtml, "<DIV", "<div")
strHtml = Replace(strHtml, "</DIV", "</div")
strHtml = Replace(strHtml, "<UL", "<ul")
strHtml = Replace(strHtml, "</UL", "</ul")
strHtml = Replace(strHtml, "<LI", "<li")
strHtml = Replace(strHtml, "</LI", "</li")
strHtml = Replace(strHtml, "<IMG", "<img")
strHtml = Replace(strHtml, "</IMG", "</img")
strHtml = Replace(strHtml, "<P", "<p")
strHtml = Replace(strHtml, "</P", "</p")
strHtml = Replace(strHtml, "<STRONG", "<strong")
strHtml = Replace(strHtml, "</STRONG", "</strong")
strHtml = Replace(strHtml, "<EM", "<em")
strHtml = Replace(strHtml, "</EM", "</em")
strHtml = Replace(strHtml, "<DL", "<dl")
strHtml = Replace(strHtml, "</DL", "</dl")
strHtml = Replace(strHtml, "<DD", "<dd")
strHtml = Replace(strHtml, "</DD", "</dd")
strHtml = Replace(strHtml, "<DT", "<dt")
strHtml = Replace(strHtml, "</DT", "</dt")
strHtml = Replace(strHtml, "<B", "<b")
strHtml = Replace(strHtml, "</B", "</b")
htmlLableToSmall = strHtml
End Function
以上是关于vb 去掉html中的回车和tab;转换部分html大写标签为小写的主要内容,如果未能解决你的问题,请参考以下文章
ThinkPHP去掉html中的空格和换行的方法(转:http://www.111cn.net/phper/thinkPhp/91462.htm)