请教一字符串截取问题
<script language= "VBScript ">
Function MyGet(Srg As String, Optional n As Integer = False, Optional start_num As Integer = 1)
Dim i As Integer
Dim s, MyString As String
Dim Bol As Boolean
For i = start_num To Len(Srg)
s = Mid(Srg, i, 1)
If n = 1 Then
Bol = Asc(s) < 0
ElseIf n = 2 Then
Bol = s Like "[a-z,A-Z] "
ElseIf n = 0 Then
Bol = s Like "# "
End If
If Bol Then MyString = MyString & s
Next
MyGet = IIf(n = 1 Or n = 2, MyString, Val(MyString))
End Function
</script>
<%=MyGet(rs( "content "))%>
提示类型不匹配
是传值有问题吗
求高手给解决一下
------解决方案--------------------噢。。
处理HTML
用正则。。
<%
Sub del_html(ByRef html)
Dim r
Set r = new RegExp
r.Pattern = " <[^> ]+> | "
r.Global = True
html = r.Replace(html, " ")
Set r = Nothing
End Sub
Dim wc
wc = " <html> w c </html> "
del_html wc
Response.Write wc
%>