Re: FN-FORUM ASP InStr
date posted 12th December 2001 15:38
what are you reying to do? check if the substring is there or extract it?
in jscript:
strTest="hairy old bollocks";
strFind="old"
strPosition=strTest.indexOf(strFind) //returns -1 if string not present,
position otherwise
if (strPosition>-1){
strNewString=strTest.substr(strPosition, strFind.length-1);
//javascript1.2, IIS4+
strNewString2=strTest.substring(strPosition, strPosition+3);
//javascript1.0. (and i think IIS3+) - first value included in substring,
final one isnt
/* strFind will return length of strFind, you knock 1 off since arrays
start at 0, so 'o'=0, 'l'=1, 'd'=2.
*/
}
so to check if the substring is present make sure the return is greater
than -1, to get the substring get its index and its length and use substr.
----- Original Message -----
From: "technoir" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Wednesday, December 12, 2001 2:44 PM
Subject: FN-FORUM ASP InStr
> any ideas why InStr wont work using JScript ?
>
>
> ============================================================
>
> * Free listing for freelancers
> * Free to advertise jobs
> * Free jobs distribution service
> * Free database of 5000 freelancers
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]