'返回某字符串在另一字符串中第N次出现的位置。
Function newInstr(str1,str2,j)
newInstr = -1
Dim i : i = 0 : Dim k : k = 0
For i = 1 to Len(str1)
strTemp = Mid(str1,i,Len(str2))
If strTemp = str2 Then
k = k + 1
If k = j Then
newInstr = i
Exit For
End if
End if
Next
End Function
';调用:newInstr("abcdcabcdcabcdeadfacdc","cdc",1)