Computing.Net > Forums > Programming > vb6 help HTML Remove

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

Reply to Message Icon

Original Message
Name: gorf
Date: July 9, 2003 at 23:53:22 Pacific
Subject: vb6 help HTML Remove
OS: winxp
CPU/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 1
Name: gorf
Date: July 9, 2003 at 23:56:29 Pacific
Reply: (edit)

vb6 Removing html
dim as string
a = "{a href="stuff"}text{/a} {p}text{/p}

{ =

if ya can help thx


Report Offensive Follow Up For Removal

Response Number 2
Name: Infinite Recursion
Date: July 10, 2003 at 00:44:53 Pacific
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 3
Name: gorf
Date: July 10, 2003 at 01:45:49 Pacific
Reply: (edit)

x = Replace(x, "{HTML}", "")
replace everthing in the tag



Report Offensive Follow Up For Removal

Response Number 4
Name: gorf
Date: July 10, 2003 at 02:46:05 Pacific
Reply: (edit)

x = Replace(x, "{[a-z]}", "")

{} = greater less then html ??


Report Offensive Follow Up For Removal

Response Number 5
Name: Infinite Recursion
Date: July 10, 2003 at 16:15:57 Pacific
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 6
Name: Infinite Recursion
Date: July 10, 2003 at 16:17:33 Pacific
Reply: (edit)

Sorry that link for the String Replacement class is at http://www.entisoft.com/ESTools/StringReplacements.HTML


Report Offensive Follow Up For Removal

Response Number 7
Name: gorf
Date: July 11, 2003 at 06:44:19 Pacific
Reply: (edit)

thx its some type of get a-z 1-9 type thing


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








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software