Results 1 to 3 of 3

Thread: query from textbox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    447

    query from textbox

    I'm wondering if it's possible to search words from a huge text instead of one or two words. Example:

    If the actual text says:
    I'm walking the dog tonight. The dog is hungry.
    Is it possible to search "walking" and "hungry" from one textbox or textarea?

  2. #2
    Addicted Member
    Join Date
    Oct 2002
    Posts
    140

    Re: query from textbox

    Yes you can get the required words from the string.
    For Eg.
    var="I'm walking the dog tonight. The dog is hungry."
    varno = InStr(1,var,"walking",0)
    If varno is 0 then word found......
    You can refer to
    http://www.w3schools.com/vbscript/vb...ons.asp#string
    and use string functions.

    hope this helps!!
    prem.

  3. #3
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: query from textbox

    You can also look into RegEx. RegEx is more efficient for complex pattern matching in strings.

    If you are simply searching one or two documents then Instr method should suffice.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

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



Click Here to Expand Forum to Full Width