ASP - classic asp substring, instr functions - Asked By asif hameed on 26-Jan-10 03:01 PM

Hi all,

I have a response from api. I am html encoding it and want to pick required info. Here is response:

Request Submitted

http://xczxc

and when i html encode it

I get smething like

<p><HTML>

<Title>

Request Submitted

</Title>

<body>

<p>

Request Submitted

</p>

<a href=javascript.history.go(-1)> Continue </a>


</body>

<HTML></p>

I wan to get following from above html

<p>

Request Submitted

</p>

It can be different based on api response. Like server busy , server dwon. invalid request. How can i do this ? Do i need to use classic as string functions ( instr, substring etc)

Please suggest me.

Regards,

Asif Hameed

classic asp substring, instr functions - Sakshi a replied to asif hameed on 26-Jan-10 11:29 PM

Substring:

Dim sItem as String
sItem="This is my String"
sItem.SubString(5)

Instr:

Dim lg
lg=instr(1, sItem, "the")
response.Write (lg)


Thanks and Regards,
http://www.CodeCollege.NET
http://www.InterviewsGuru.info


mv ark replied to asif hameed on 30-Jan-10 07:36 AM
VBScript supports Regular expressions. Use it to extract the desired portion of the complete string.

You can find related code here -
http://www.robvanderwoude.com/vbstech_regexp.php
http://msdn.microsoft.com/en-us/library/ms974570.aspx