asp 获得指定字符串

来源:百度知道 编辑:UC知道 时间:2024/06/25 00:27:46
asp 获得指定字符串
<%
str=aaaaaaddddcccc
%>
怎么才能获得dddd?
二楼的不对,!!!

<%
str="aaaaaaddddcccc"

Function getStr(str,targetStr)
Dim ary(), l, i
l = Len(str)
ReDim ary(l - 1)

For i = 1 To l
ary(i - 1) = Mid(str, i, 1)
if targetStr=ary(i-1) then
getStr=getStr&ary(i-1)
end if
Next

End Function

response.write getStr(str,"d")
%>
你测试了吗