|
| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
vb6 help HTML Remove
|
Original Message
|
Name: gorf
Date: July 9, 2003 at 23:53:22 Pacific
Subject: vb6 help HTML RemoveOS: winxpCPU/Ram: 2600+ / 512mb pc3200 |
Comment: vb6 Removing html dim as string a = "text text ...? if ya can help thx
Report Offensive Message For Removal
|
|
Response Number 2
|
|
Reply: (edit)I'm not entirely sure on what you are asking here. But if you are trying to remove HTML tags from a text file then look into the substr function... It allows you to substitute what you want for what you have... in this case, substituting a blank/nothing in place of HTML tags. Infinite Recursion
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
|
Reply: (edit)I am not sure on how to strip all HTML tags from a file using VB in a single line of code (unless you want to run it through a Sed or Awk process ;)) However, using VB's Replace function as: strKeywords = Replace (txtKeywords.Text, "yourHTMLTag", " ") You could have a new string (strKeywords) that has the HTML tag that you specify removed from txtKeywords.Text. Perhaps if you put this in a loop for all tags, or run it through an array of tags for comparisons, etc.. it would reduce the workload. However, I don't know enough about the Replace command to know if it is possible to utilize regular expressions within it... I would air on the side of it not being possible. Although, I looked on the Net for something that may be able to help you and came across something of interest, I did not read much of it. But it is a String Replacements Class within a Entisoft Tools 2.0 Object Library. It may have something in there that could help you remove your tags... otherwise, I would loop through with the VB Replace function and compare against an array of known tags. Infinite Recursion
Report Offensive Follow Up For Removal
|
|
Response Number 8
|
Name: Burbble
Date: July 12, 2003 at 09:14:20 Pacific
|
Reply: (edit)Why not do this? Dim tmpLong As Long Dim tmpLong2 As Long Dim tmpString As String Dim tmpHTML As String tmpHTML = Text1.Text tmpLong = InStr(1, tmpHTML, """" & ">") tmpLong2 = InStr(tmpLong, tmpHTML, "") tmpString = Mid(tmpHTML, tmpLong + 2, (tmpLong2 - 2) - tmpLong) tmpString is the final result.
-Burbble
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Programming Forum Home
|
|
|