Ask a Question related to ASP, Design and Development.

  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. Similar Questions and Discussions

    1. website search functionality
      I'm using ASP and want to implement a search functionality where a user can enter a string to search and find any matches in the website for the...
    2. yahoo search on my website
      Hi, My website only works when the name of the main page is default(in my case) or index. When I do a Yahoo search on my own website the name that...
    3. Search Function on Website
      Hi All, I wish to add a search function on the menu bar for users to search MY site, not a Google or other search engine link. I was going to...
    4. #25786 [NEW]: PHP website uses cookies to remember last search phrase in search box
      From: tipsen at imada dot sdu dot dk Operating system: - PHP version: Irrelevant PHP Bug Type: Unknown/Other Function Bug...
    5. HELP! Simple website search
      I want to add a search facility to my site. How do i go about this? Thanks in advance, JimR99
  3. #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

  4. #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

  5. #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

Posting Permissions

  • You may not post new threads
  • You may 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