我们把函数名命名为GetMyContent
[code lang="vb"]Function GetMyContent(ConStr,StartStr,OverStr,IncluL,IncluR)
If ConStr="" or IsNull(ConStr)=True Or StartStr="" or IsNull(StartStr)=True Or OverStr="" or IsNull(OverStr)=True Then '判断是不是空
GetContent="0"
Exit Function
End If
Dim ConStrTemp
Dim Start,Over
ConStrTemp=Lcase(ConStr)
StartStr=Lcase(StartStr)
OverStr=Lcase(OverStr)
Start = InStrB(1, ConStrTemp, StartStr, vbBinaryCompare)'判断是否包含
If Start<=0 then
GetMyContent= 0
Exit Function
Else
If IncluL=False Then
Start=Start+LenB(StartStr)
End If
End If
Over=InStrB(Start,ConStrTemp,OverStr,vbBinaryCompare)
If Over<=0 Or Over<=Start then
GetMyContent="无"
Exit Function
Else
If IncluR=True Then
Over=Over+LenB(OverStr)
End If
End If
GetMyContent=MidB(ConStr,Start,Over-Start)
End Function[/code]

分类: Asp

发表评论

电子邮件地址不会被公开。 必填项已用*标注