Richard Aubin wrote:
I have this code in html:
<a href="domain.com">click here</a>
How can I grab the string click here or any other strings between ">
and </a>?
How's this?
\\\
Dim s As String = "<a href=""domain.com"">click here</a>"
Dim startPos As Integer
Dim endPos As Integer
Dim t As String
'Get the position of the > character
startPos = InStr(s, ">")
'Get the position of the </a> characters
endPos = InStr(s, "</a>")
'Make sure both strings were found and the end pos is after the startpos
If startPos > 0 And endPos > startPos Then
'Skip over the > character itself
startPos += 1
'Extract the characters between startPos and endPos
t = Mid(s, startPos, endPos - startPos)
'Display the result
MsgBox(t)
End If
///
--
(O)enone