Removing a Querystring Name & Value

S

scott

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top