Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Trimmed display issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedTrimmed display issue

 Post Reply Post Reply
Author
rocketdawg View Drop Down
Newbie
Newbie
Avatar

Joined: 03 August 2004
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocketdawg Quote  Post ReplyReply Direct Link To This Post Topic: Trimmed display issue
    Posted: 24 November 2005 at 5:20pm
When I display only the first 200 characters of the story as a brief teaser, something funny happens. If on chance, the 200th character is within an html formating tag, the formating continues on through the loop and displays into the next brief description, and so on.
 
Here is the code to display the brief story description:
 
 
<p class="text"><% = (left(rsStory("STORY_DESCRIPTION"), 200))  %>  ...</p>
 
I would think that removing the html formating tags prior to browser display would do it, but does anyone know how to do that?
 
ie: 
 
txt = rsStory("STORY_DESCRIPTION")
 
txt2 = replace(txt,< htmlformatcode >, "")
 
and then
 
<p class="text"><% = (left(txt2), 200))  %>  ...</p>
 
Sound good in my head, but ...
 
anybody have any good suggestions? How would I do this?
Back to Top
rocketdawg View Drop Down
Newbie
Newbie
Avatar

Joined: 03 August 2004
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocketdawg Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2005 at 4:07pm

I found the answer in case anybody ever searches for this problem again.

 
Function RemoveHTML( strText )
	Dim RegEx
	Set RegEx = New RegExp
	RegEx.Pattern = "<[^>]*>"
	RegEx.Global = True
	strText = Replace(LCase(strText), "<br>", chr(10))
	RemoveHTML = RegEx.Replace(strText, "")
End Function
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.