|
-
Jul 18th, 2006, 03:12 PM
#1
[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?
-
Jul 18th, 2006, 03:16 PM
#2
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)
-
Jul 18th, 2006, 04:49 PM
#3
Re: Parse Code between tags
Worked beautifully, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|