[RESOLVED] Parse Code between tags
I have the following: "<option value='78694'>God Only Knows</option>"
The way I was going to parse it was to take the entire string, remove "</option>" and then read each character backwards until I reached ">".
I don't like this way of doing it, as it seems slow. Could someone maybe offer a faster way to achieve this?
Re: Parse Code between tags
Assuming there is only one set of tags in the input, something like this should work:
VB Code:
Dim sText As String, lStart As Long, lEnd As Long
sText = "<option value='78694'>God Only Knows</option>"
lStart = InStr(1, sText, ">") + 1
lEnd = InStrRev(sText, "<")
Debug.Print Mid$(sText, lStart, lEnd - lStart)
Re: Parse Code between tags
Worked beautifully, thanks.