InStr Help

Discussion in 'ASP General' started by Graham Mattingley, Nov 10, 2003.

  1. How do I use InStr to find the string d="1"

    I have tryed

    InStr(text,"d="1"") and it does not work

    I have tryed a few other variations and I cant get it to work

    Thanks

    Graham
    Graham Mattingley, Nov 10, 2003
    #1
    1. Advertising

  2. Graham Mattingley

    Evertjan. Guest

    Graham Mattingley wrote on 10 nov 2003 in
    microsoft.public.inetserver.asp.general:

    > How do I use InStr to find the string d="1"
    >
    > I have tryed
    >
    > InStr(text,"d="1"") and it does not work
    >
    > I have tryed a few other variations and I cant get it to work


    " is clientside html, not serverside asp vbs

    try:


    s = "d=""1"""

    InStr(text,s)

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Nov 10, 2003
    #2
    1. Advertising

  3. Graham Mattingley

    Steven Burn Guest

    InStrRev(stringtocheck, "d=1")

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)
    Graham Mattingley <> wrote in message
    news:bonrbk$t4$1$...
    > How do I use InStr to find the string d="1"
    >
    > I have tryed
    >
    > InStr(text,"d=&quot;1&quot;") and it does not work
    >
    > I have tryed a few other variations and I cant get it to work
    >
    > Thanks
    >
    > Graham
    >
    >
    Steven Burn, Nov 10, 2003
    #3
  4. Graham Mattingley

    dlbjr Guest

    strFind = "d=" & Chr(34) & "1" & Chr(34)
    InStr(text,strFind)

    -dlbjr

    Discerning resolutions for the alms
    dlbjr, Nov 10, 2003
    #4
  5. Graham Mattingley

    Chris Barber Guest

    OK, basically the string:

    d="1"

    needs to have the doublequotes 'doubled' up when placed directly into a
    string variable as:

    pstrStringToFind = "d=""1"""

    So you can now do:

    If InStr(pstrSomeString, pstrStringToFind) > 0 Then
    'String Found
    End If

    You can also do:

    pstrStringToFind = "d=" & Chr(34) & "1" & Chr(34)

    since Chr(34) is in fact a doublequote character.

    It's a pity that VBScript doesn't support the use of either ' or " as the
    text delimiter (bad choice of comment delimiter really) cos in JavaScript
    it's dead easy:

    var pstrString = 'd="1"';

    A *lot* easier on the eye.

    Regards,

    Chris.

    "Graham Mattingley" <> wrote in message
    news:bonrbk$t4$1$...
    How do I use InStr to find the string d="1"

    I have tryed

    InStr(text,"d=&quot;1&quot;") and it does not work

    I have tryed a few other variations and I cant get it to work

    Thanks

    Graham
    Chris Barber, Nov 10, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kathy Burke
    Replies:
    0
    Views:
    402
    Kathy Burke
    Nov 24, 2003
  2. =?Utf-8?B?cm9kY2hhcg==?=

    InStr test

    =?Utf-8?B?cm9kY2hhcg==?=, Nov 7, 2006, in forum: ASP .Net
    Replies:
    12
    Views:
    604
    =?Utf-8?B?cm9kY2hhcg==?=
    Nov 15, 2006
  3. Replies:
    1
    Views:
    3,460
    Victor Bazarov
    Jul 13, 2005
  4. J. Muenchbourg

    InStr, substr, Mid ???

    J. Muenchbourg, Aug 13, 2003, in forum: ASP General
    Replies:
    1
    Views:
    151
  5. Joey Martin

    SECOND instance in instr

    Joey Martin, Jul 7, 2004, in forum: ASP General
    Replies:
    6
    Views:
    127
    Mark Schupp
    Jul 7, 2004
Loading...

Share This Page