String Comparison in ASP

Results 1 to 2 of 2

Thread: String Comparison in ASP

  1. #1
    Christopher Chin Guest

    Default String Comparison in ASP

    What&#039s the easiest way to find out if the email address supplied to me via a form contains a certain domain name? Ex. I&#039m looking to find out if the email addres contains AOL.COM and do something with it.<BR><BR>I can do a InStrRev (i think), but I was wondering if there was an easier way. Maybe something intrinic to VBscript or ASP.<BR><BR>Thanx

  2. #2
    Join Date
    Dec 1969

    Default RE: String Comparison in ASP

    There is an easier way, using the InStr function.<BR><BR>Say strEmail contains the user&#039s email address:<BR><BR>If InStr(1,strEmail,"AOL.COM",1) &#062; 0 then<BR><BR>&#039the email address contains in it!<BR><BR>Else<BR><BR>&#039the email address does NOT contain in it<BR><BR>End If<BR><BR>You can read the technical docs on InStr at:<BR><BR><BR>Happy Programming!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts