Removing a Querystring Name & Value

Discussion in 'ASP General' started by scott, Jul 28, 2005.

  1. scott

    scott Guest

    Below, I'm trying to remove the querystring name& value of "catID=12".
    I mananged to isolate the RESULTS part, but I need to be able to strip the
    querystring name and it's value, no matter if the value is 1, 2 or 3 digits.
    I
    chose to isolate the part I'd be removing below because I know I can take it
    and run a replace and get correct string, although I hardcoded the qs name.

    Basically, I'd like to end up with a function that I could just pass the
    name of the querystring and the function would remove the qs name and it's
    value.

    One other issue, if the querystring name and value are the only part of the
    querystring, I need to delete the "?" within the qs.

    Any help?

    CODE:

    sQueryString = "millID=2&catID=12"

    iMarker = InStr(sQueryString ,"catID")
    mystring= Right(sQueryString ,Len(sQueryString )-iMarker+1)


    RESULTS:
    mystring=catID=1
     
    scott, Jul 28, 2005
    #1
    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. Jon
    Replies:
    3
    Views:
    23,848
    bruce barker
    Feb 9, 2004
  2. Mehdi
    Replies:
    6
    Views:
    36,254
    sloan
    Apr 6, 2006
  3. John Davis
    Replies:
    2
    Views:
    426
    Dave Anderson
    Aug 18, 2003
  4. scott

    Removing a Querystring Name & Value

    scott, Jul 29, 2005, in forum: ASP General
    Replies:
    10
    Views:
    267
    Chris Hohmann
    Aug 1, 2005
  5. Adeel Ahmad
    Replies:
    1
    Views:
    583
    Anthony Jones
    Mar 7, 2006
Loading...

Share This Page