String search

Results 1 to 3 of 3

Thread: String search

  1. #1
    Cuong Guest

    Default String search

    Hi <BR>I have a text string which I put it in a variable called strResult. Inside this string there are words like "message.response=0" and so on..this message.response=0 can be anywhere in the string variable. how can I do a search on this string to grap this message.response and see if it is equal to 0 or something else?<BR><BR>please help.

  2. #2
    Join Date
    Dec 1969

    Default RE: String search

    In VBScript you can use the InStr function, which is pretty well documented in MSDN etc..<BR><BR>Something like this:...<BR><BR>intWhere = InStr(strResult,"message.response=")<BR><BR>...wil l return the location of the first character of the string (the "m" of "message" in this instance). Simply add the relative position of the 0 to the start of your string (intWhere + 17 in this example). So to find the value...<BR><BR>intValue = Mid(strResult,intWhere + 17, 1)<BR><BR>...This uses the Mid function (which is also well documented in MSDN etc.) and assumes that the value of message.response will be a single digit.

  3. #3
    Cuong Guest

    Default RE: String search

    Thanks for that.. I will give it a try..

Posting Permissions

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