|
-
Aug 13th, 2007, 08:30 PM
#1
Thread Starter
Addicted Member
Re: Find all words in string
 Originally Posted by anhn
vb Code:
Option Explicit
Function FindAllRef(Packet As String) As String
Const StartFlag = "<a href="
Const EndFlag = ">"
Dim n1 As Long
Dim n2 As Long
Dim sTemp As String
Dim sRef As String
n1 = 1
Do
n1 = InStr(n1, Packet, StartFlag, vbTextCompare)
If n1 = 0 Then
Exit Do
End If
n1 = n1 + Len(StartFlag)
n2 = InStr(n1, Packet, EndFlag, vbTextCompare)
If n2 > 0 Then
sRef = Mid(Packet, n1, n2 - n1)
If sTemp <> "" Then
sTemp = sTemp & vbNewLine
End If
sTemp = sTemp & sRef
n1 = n2 + Len(EndFlag)
End If
Loop
FindAllRef = sTemp
End Function
'-- Use function:
' Text1 = FindAllRef(aNewPacket)
worked perfect, 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
|