28,390
社区成员
发帖
与我相关
我的任务
分享
'/**************************************************
' * 字符串处理类
' * 2008-6-14
' **************************************************
'**************************************************/
' <summary>
' 过滤html为text
' </summary>
'<param name="text">字符串</param>
'<param name="full">是否是过滤html标签</param>
Function HTML2Text(text ,full)
Dim temp
temp = text
temp = Replace(temp ," " ," ")
temp = Replace(temp ,Chr(10) ,"<br />")
temp = Replace(temp ,"'" ,"'")
If full <> 1 And full <> True Then
temp = Replace(temp ,"<" ,"<")
temp = Replace(temp ,">" ,">")
End If
HTML2Text = temp
End Function
' <summary>
' 还原text为html
' </summary>
'<param name="html">html数据</param>
Function Text2HTML(html)
Dim temp
temp = html
tmep = Replace(temp ,"<br />" ,Chr(10))
temp = Replace(temp ," " ," ")
temp = Replace(temp ,"'" ,"'")
temp = Replace(temp ,"<" ,"<")
temp = Replace(temp ,">" ,">")
Text2HTML = temp
End Function
' <summary>
' 过滤html为text
' </summary>
'<param name="text">字符串</param>
'<param name="full">是否是过滤html标签</param>
Function HTML2Text(text ,full)
Dim temp
temp = text
temp = Replace(temp ," " ," ")
temp = Replace(temp ,"'" ,"'")
If full <> 1 And full <> True Then
temp = Replace(temp ,"<" ,"<")
temp = Replace(temp ,">" ,">")
End If
HTML2Text = temp
End Function
' <summary>
' 还原text为html
' </summary>
'<param name="html">html数据</param>
Function Text2HTML(html)
Dim temp
temp = html
tmep = Replace(temp , vbcrlf ,"<br />")
temp = Replace(temp ," " ," ")
temp = Replace(temp ,"'" ,"'")
temp = Replace(temp ,"<" ,"<")
temp = Replace(temp ,">" ,">")
Text2HTML = temp
End Function