Dim myString, lnLoop, lnPos1, lnPos2 myString = "start1234endstart5678endthis is a teststart111end" lnPos1 = 1 lnPos2 = 1 Do While True lnPos1 = InStr(lnPos2, myString, "start", 1) If lnPos1>0 Then lnPos1 = lnPos1 + 5 lnPos2 = InStr(lnPos1, myString, "end", 1) If lnPos2>0 Then Response.Write Mid(myString, lnPos1, lnPos2-lnPos1) & "<BR>" End If Else Exit Do End If Loop>Hi All,
>lb = "start" >rb = "end" >StrString = a >lbStrPosition = "" > >For Each StrEachTag In Split(StrString, Len(lb) - 5) > If lbStrPosition = "" Then > lbStrPosition = 1 > Else > lbStrPosition = lbStrPosition + 3 > End If > lbStrPosition = InStr(lbStrPosition, StrString, lb) > rbStrPosition = InStr(lbStrPosition, StrString, rb) > StrEnd = rbStrPosition - lbStrPosition + Len(rb) > Response.Write Mid(StrString , lbStrPosition, StrEnd) >Next >>