|
|
 |
| Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

February 20th, 2004, 12:11 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Strip HTML with ASP Question
Hello,
I am trying to strip all the html tags, including as well as all end of line characters so that whats left is all on one line. I have got it working for just the html tags but cant for the life of me get it to clean the or end of line characters. Here's what I have so far. Any suggestions?
Function StripHTMLTag(ByVal sText)
StripHTMLTag = ""
fFound = False
Do While InStr(sText, "<")
fFound = True
StripHTMLTag = StripHTMLTag & " " & Left(sText, InStr(sText, "<")-1)
sText = MID(sText, InStr(sText, ">") + 1)
Loop
Do While InStr(sText, " ")
fFound = True
StripHTMLTag = StripHTMLTag & " " & Left(sText, InStr(sText, " ")-1)
sText = MID(sText, InStr(sText, " ") + 1)
Loop
StripHTMLTag = StripHTMLTag & sText
If Not fFound Then StripHTMLTag = sText
End Function
|

January 17th, 2005, 08:15 AM
|
|
Registered User
|
|
Join Date: Jan 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here I think you have the response to your question, i hope that helps you. You were very near.
Function StripHTMLTag(ByVal sText)
StripHTMLTag = ""
fFound = False
Do While InStr(sText, "<")
fFound = True
StripHTMLTag = StripHTMLTag & " " & Left(sText, InStr(sText, "<")-1)
sText = MID(sText, InStr(sText, ">") + 1)
Loop
sText = StripHTMLTag & sText
StripHTMLTag = ""
Do While InStr(sText, " ")
fFound = True
StripHTMLTag = StripHTMLTag & " " & Left(sText, InStr(sText, " ")-1)
sText = MID(sText, InStr(sText, " ") + 6)
Loop
StripHTMLTag = StripHTMLTag & sText
If Not fFound Then StripHTMLTag = sText
End Function
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |