Abbreviated Summary

Results 1 to 2 of 2

Thread: Abbreviated Summary

  1. #1
    Join Date
    Dec 1969

    Default Abbreviated Summary

    Hello All:<BR><BR>I am working on an ASP DB application which contains a text field. I want to only display the first 200 characters. <BR><BR>‘ ** ASP Code ** <BR>Summary = Left(Message,200) <BR><BR><BR>The issue with the following code is that a word that is at the end of the summary might be half complete. <BR><BR>The optimal solution is obtain the first 200 characters in the message and then remove the last word, so I have no incomplete words in the summary.<BR><BR>What is the best method to go about obtaining these results?<BR><BR>Thanks <BR>Stuart <BR>

  2. #2
    Join Date
    Dec 1969

    Default Not too hard...

    &#060;%<BR>Summary = Left( Message, InStrRev( Message, " ", 200 ) )<BR>%&#062;<BR><BR>That starts at character 200 and looks backwards for a space. Then gives you the characters left of the space. It&#039;s not perfect, of course, since you might discard words that were separated by things other than a space. But it&#039;s a practical solution.<BR><BR>

Posting Permissions

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