InStr when the string contains "

Advanced programming using WinTask scripting language

InStr when the string contains "

Postby Walt on Thu Sep 18, 2014 3:52 pm

Hi,
I need to find if in a source web page this string is there or not:
<td colspan=”2”>No matching claims found.</td>
But as the string contains "2", the InStr syntax below is not accepted:
InStr(pageSource$,"<td colspan=”2”>No matching claims found.</td>")

How can I use inStr when the string contains " ?
thanks.
Walt
 
Posts: 13
Joined: Fri Dec 24, 2004 10:44 am

Re: InStr when the string contains "

Postby TechSupport on Fri Sep 19, 2014 7:08 am

Hello,
As “ is used as separator for strings, it’s a bit tricky. You have to replacethe " character by chr$(34), I made it step by step:
b$="<td colspan="
c$=b$+chr$(34)+"2"+chr$(34)+">No matching claims found.</td>"
msgbox(c$)
ret=InStr(pageSource$,c$)

Regards.
WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am


Return to Scripts programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron