grabbing first 50 words?

Results 1 to 2 of 2

Thread: grabbing first 50 words?

  1. #1
    Join Date
    Dec 1969

    Default grabbing first 50 words?

    What would be an easy way to grab the first 50 or so words from a description field in SQL serve using VBScript?<BR><BR>I had though about looping through the description field&#039;s text and looking for spaces, but there must be a better way? It doesn&#039;t need to be exact, either... I just want to display a short summary (the first 50 words or so) and then have a more... link after the text... simple enough, but just want to do it the most efficient way. Any ideas?<BR>~~Chaotix

  2. #2
    Join Date
    Dec 1969

    Default RE: grabbing first 50 words?

    Instead of going for exactly 50 words you could just pick an approximate number of characters and then search for the next space after that.<BR><BR> somestring = Mid(description, 1, instr(250,description," "))<BR><BR>Not perfect but may do the trick. ; )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts