Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Show Limited Text
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Show Limited Text

 Post Reply Post Reply
Author
__n3o__ View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2005
Location: United Kingdom
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote __n3o__ Quote  Post ReplyReply Direct Link To This Post Topic: Show Limited Text
    Posted: 08 March 2006 at 3:43pm
Embarrassed... Need a clever person to point me in the right direction Cry

I am collecting some content from a DB field, but only want to show the first 15 words of what ever is in there.. Like a mini preview

I thought I could use the Trim function, but am I right in thinking this only takes out spaces?  If anyone could tell me what I should be using it would be appreciated Big smile

Thanks
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2006 at 8:18pm
15 first words is a little more tricky. 15 first characters is easy as you could juse use Repsonse.Write(left(dbfield,15))
Now, 15 words you can put them into an array, use 14 members count up and spit them out, there are other ways of doing that too but for simplicity I would stick with characters rounding up to the next whitespace.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2006 at 9:04pm
With 15 words, I would select the first 200 or so characters via SQL and then using VBScript to strip it down to the first 15 words.
Back to Top
__n3o__ View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2005
Location: United Kingdom
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote __n3o__ Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2006 at 8:21am
Thanks chaps... Big smile

Micheal thats perfect dude... Thumbs Up
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.