|
Rem 函数StrPlace用于检测一个字符串在另一个字符串中,某次出现的位置
Rem 参数说明:str为待检测的字符串;keyword为关键字符串;times为第N次数
Function StrPlace(str,keyword,times)
If str="" Or keyword="" Or times="" Then Exit Function
Dim i,n,l
n = Split(str,keyword)
l = UBound(n)
If l=0 Then Exit Function
If times>l Then Exit Function
'以上为判断参数的合法性
For i = 0 To times-1
StrPlace=StrPlace+Len(n(i))
Next
StrPlace=StrPlace+Len(keyword)*(times-1)+1
End Function
Response.Write(StrPlace("123981294312945312","12",3)) |
|