Displaying first 10 words

Results 1 to 5 of 5

Thread: Displaying first 10 words

  1. #1
    Michael W. Guest

    Default Displaying first 10 words

    Howdy! I have a small little question. I&#039m pulling off a record from a database, and I&#039m looking to show the first 10 words only of that record. I know how to show the first characters, but I need the first 10 words. Any suggestions? Thanks for the help!

  2. #2
    Join Date
    Dec 1969

    Default RE: Displaying first 10 words

    try:<BR>Instr function

  3. #3
    Kristen Guest

    Default RE: Displaying first 10 words

    Yea, also the Split function may be of help.<BR>myArray = Split( rs("dbfieldname") )<BR><BR>The first 10 elements of the array will contain your first 10 words.<BR>

  4. #4
    Join Date
    Dec 1969

    Default Correct, and...

    ...since this person is probably a newbie, you should point out that the easy way to then convert just those first 10 words back to a string is...<BR><BR>&#060;%<BR>myArray = Split( rs("dbfieldname") )<BR>ReDim Preserve myArray( 9 ) &#039 arrays start at zero, so this cuts to 10 elements<BR>tenWords = Join( myArray )<BR>%&#062;<BR><BR>

  5. #5
    Michael W. Guest

    Default Thank You!

    Excellent, it works perfectly, thanks!

Posting Permissions

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