Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Trimming Words
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Trimming Words

 Post Reply Post Reply Page  <123
Author
dj1811 View Drop Down
Newbie
Newbie


Joined: 11 February 2005
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj1811 Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2005 at 6:38pm
Originally posted by Misty Misty wrote:

The end tags for paragraphs are </p>.
 
The end tags are not </p>.  That is why the script is not working.  There is a <p> at the beginning of each paragraph only.  Need to search for <p> instead of </p>.  New code in a moment...
 
 
...try this instead:
 
        FUNCTION ParaTrim(input)
     intP = 0
     intL = 0
     FOR count = 1 to LEN(input)
          IF MID(input,count,3)="<p>" THEN
               intP=intP+1
               IF intP=5 THEN
               intL=count
               END IF
          END IF
     NEXT
     IF intL>0 THEN
          ParaTrim = LEFT(input,intL-1) & "...."
     ELSE
          ParaTrim = input
     END IF
     END FUNCTION
 
You can delete the & "...." if you don't like the elipses ....


Edited by dj1811 - 22 February 2005 at 6:47pm
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 25 February 2005 at 1:40am
Thank you all for the help! The code that dj1811 gave me in the last posting worked.
Back to Top
 Post Reply Post Reply Page  <123

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.