Private Function split_vb5(ByVal sstr As String, spstr As String) As VariantDim starstr, lenstr, cur As IntegerDim backstr() As Stringstarstr = InStr(sstr, spstr)cur = starstr + 1lenstr = Len(sstr)ReDim backstr(0)backstr(0) = Left(sstr, starstr - 1)For x = starstr + 1 To lenstr If Mid(sstr, x, 1) = spstr Then ReDim Preserve backstr(UBound(backstr) + 1) backstr(UBound(backstr)) = Mid(sstr, cur, x - cur) cur = x + 1 Debug.Print backstr(UBound(backstr)) End IfNextsplit_vb5 = backstr()End Function(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)
'******************************
Private Function InStrRev_vb5(ByVal start As Integer, ByVal str1 As String, ByVal str2 As String)str1 = revstr(str1)str2 = revstr(str2)start=Len(str1)-startInStrRev_vb5 = Len(str1) - InStr(start, str1, str2)End FunctionPrivate Function revstr(str As String) As StringDim x, lenstr As Integerlenstr = Len(str)For x = lenstr To 1 Step -1 revstr = revstr & Mid(str, x, 1)NextEnd Function(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)