Professional Web Applications Themes

website search - ASP

Hi, I'm trying to nicely display the results of a search but some results are longer than others in length. Is there a way of only displaying the first 30 characters of a search result (i.e. enough to make sure they know what it is but not enough to mess up the formatting of the page) ? Any online tutorials etc. much appreciated....

  1. #1

    Default website search

    Hi,

    I'm trying to nicely display the results of a search but some results are
    longer than others in length. Is there a way of only displaying the first 30
    characters of a search result (i.e. enough to make sure they know what it is
    but not enough to mess up the formatting of the page) ?

    Any online tutorials etc. much appreciated.



    John Smith Guest

  2. #2

    Default Re: website search

    Try a function something like this...

    function truncateString(strString)
    if len(string) > 30 then
    truncateString = mid(strString, 1, 30)
    else
    truncateString = strString
    end if
    end function



    John Smith wrote:
    > Hi,
    >
    > I'm trying to nicely display the results of a search but some results are
    > longer than others in length. Is there a way of only displaying the first 30
    > characters of a search result (i.e. enough to make sure they know what it is
    > but not enough to mess up the formatting of the page) ?
    >
    > Any online tutorials etc. much appreciated.
    >
    >
    David C Holley Guest

  3. #3

    Default Re: website search

    > Is there a way of only displaying the first 30
    > characters of a search result
    Left()

    see the VBScript docs at [url]http://msdn.microsoft.com/scripting/[/url]



    ________________________________________
    Why? Why was I programmed to feel pain?

    Atrax. MVP, IIS
    [url]http://rtfm.atrax.co.uk/[/url]

    newsflash : Atrax.Richedit 1.0 now released.
    click the link above!

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Atrax Guest

  4. #4

    Default Re: website search

    Atrax wrote on 04 jul 2003 in microsoft.public.inetserver.asp.general:
    >> Is there a way of only displaying the first 30
    >> characters of a search result
    >
    > Left()
    Using Left what is Left out is the stuff on the Right,
    so that what is Left is the stuff on the Left ?

    Right ?

    ;-)

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

Similar Threads

  1. Search Engine in Website
    By paradistina in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 1
    Last Post: March 18th, 01:34 PM
  2. yahoo search on my website
    By willem joubert in forum ASP.NET Web Services
    Replies: 0
    Last Post: May 22nd, 08:35 AM
  3. Search Function on Website
    By livingloans in forum Dreamweaver AppDev
    Replies: 1
    Last Post: April 28th, 11:54 AM
  4. search box for my all-Flash website
    By Chayah in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 25th, 07:41 PM
  5. #25786 [NEW]: PHP website uses cookies to remember last search phrase in search box
    By tipsen at imada dot sdu dot dk in forum PHP Development
    Replies: 0
    Last Post: October 8th, 08:24 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139