473,412 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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 6841
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: DTB | last post by:
I am trying to convert a complex function from Oracle to SQL Server and have come across Oracle's Instr() function. I see SQL Server has CHARINDEX() which is similar, however it does not provide...
6
by: Chris Calzaretta | last post by:
Hello Everybody, Question instr function will give you the first instance of the finding so EX: so your string looks like string1 = "testing>This is > just a test > testtesttest"...
3
by: Mary | last post by:
MemberID VID 1002 1001 1003 1002 1004 1003 1005 1003 1007 1001...
4
by: fischerspooner | last post by:
Hi, I'm banging my head against the desk because I can't find a solution for the following simple problem. Case: There is a column in a table that has FamilyName and FirstName(s) in one field....
12
by: rodchar | last post by:
hey all, i'm getting a result that i don't understand i have a string "test1, test2" If InStr("test1") and InStr("test2") Then 'Inside EndIf The inside is not running for some reason. Any...
3
by: lstrudeman | last post by:
Hello; A friend gave me this syntax and they are unavailable at the moment and I need this asap. I am trying to figure out how SQL figures this out. Below the syntax takes a field in a file and...
3
by: Steve | last post by:
I use the instr function frequently to find particular characters within a string and manipulate them eg all characters to the left of a particular character. If I understand correctly, Instr...
3
by: Kubie | last post by:
I'm having problems finding the syntax/comands that do the this correctly. I'm must not be doing the join right or something.. List one AAC1234 CDA2w31 12ZZC12 12TRE1 23234 243
3
by: Alex Pavluck | last post by:
I have a date stored like this '2004 - 2006' and I use this code to get startyear and stopyear StartYear: Trim(Left(,InStr(,"-")-1)) StopYear: Trim(Right(,InStr(,"-")-1)) Is there a way to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.