Results 1 to 3 of 3

Thread: detecting if something is in a string

  1. #1

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172

    detecting if something is in a string

    I get info from a server but i want to see if it contains a certain text.... in example this :


    test = winsock.getdata


    and i want to check if it contains (in example) "HAHA"


    but it does contain more text and might not be at the beginning or something :S

    (i knew this but i forgot it)
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    Use the Instr function:
    If Instr(test, "HAHA") > 0 Then
    ' the string is there
    Else
    ' it isn't
    End If
    "It's cold gin time again ..."

    Check out my website here.

  3. #3

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    darn i knew i had it correct the entire time :S... i just put it in a SELECT ... so it didnt detect it but i didn't forget it then thnx
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

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