|
-
Dec 30th, 2000, 07:08 PM
#1
Thread Starter
Addicted Member
how would I remove any text in a string that is between "<" and ">"? Im working on removing HTML from a string. Thanks for your help!
-
Dec 30th, 2000, 08:30 PM
#2
I worked on this a little bit, this version only works if all the HTML is correct, so it's not very useful if there are mistakes, and I haven't done a lot of testing, but here:
Code:
Private Function RemoveHTML(strString As String) As String
Dim intStart As Integer
Dim intLength As Integer
Dim intEnd As Integer
Dim strLookFor As String
If InStr(1, strString, "<") <> 0 Then
Do Until InStr(1, strString, "<") = 0
intStart = InStr(1, strString, "<")
If intStart > 0 Then
intEnd = InStr(intStart, strString, ">")
If intEnd > 0 Then
intLength = intEnd - intStart
strlookup = Mid(strString, intStart, intLength + 1)
strString = Replace(strString, strlookup, "")
End If
End If
Loop
End If
RemoveHTML = strString
End Function
'usage
Private Sub Command1_Click()
Text1.Text = RemoveHTML(Text1.Text)
End Sub
this removes anything between "<" and ">"
let me know if you come up with anything else.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
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
|