InStr Help

G

Graham Mattingley

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
 
E

Evertjan.

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)
 
S

Steven Burn

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)
 
D

dlbjr

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

-dlbjr

Discerning resolutions for the alms
 
C

Chris Barber

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.

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
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top