469,903 Members | 2,006 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

InStr Help

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
Jul 19 '05 #1
4 6711
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)
Jul 19 '05 #2
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 <gr****@technocom.com> wrote in message
news:bo******************@news.demon.co.uk...
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

Jul 19 '05 #3
strFind = "d=" & Chr(34) & "1" & Chr(34)
InStr(text,strFind)

-dlbjr

Discerning resolutions for the alms
Jul 19 '05 #4
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" <gr****@technocom.com> wrote in message
news:bo******************@news.demon.co.uk...
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

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Chris Calzaretta | last post: by
3 posts views Thread by Mary | last post: by
12 posts views Thread by rodchar | last post: by
3 posts views Thread by Steve | last post: by
3 posts views Thread by Alex Pavluck | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.