[RESOLVED] How to get the next indexof?
I'm just extracting some very small text from a bigger text file. So, suppose I'm getting a dl link from a "" tag, there are multiple download links and the way i'm 'extracting' the download link from there uses the indexof method. There are multiple download links, so how would I get the next indexof? Any more details needed tell me.
Re: How to get the next indexof?
I'm pretty sure you can specify a start index to IndexOf to indicate from where it should start looking. Use the index of the last find (+ 1 probably) as that start index.
A much easier method is to use regular expressions though. I am assuming you actually meant [code][/code] tags? That is a very easy match and any regex example should be able to show you how to get it.
Re: How to get the next indexof?
indexof has an overload where you can specify the startIndex:
vb Code:
Dim teststr As String = "testtesttest"
Dim startAt As Integer = 0
Do While teststr.IndexOf("test", startAt) <> -1
MsgBox(teststr.IndexOf("test", startAt))
startAt = teststr.IndexOf("test", startAt) + 4
Loop