Solved

Compare 2 strings if string 2 has the same word in it do something

Posted on 2010-11-30
4
347 Views
Last Modified: 2013-01-20
Hello All;

I need to compare 2 string together and see if

str1 = "carrzkiss"
str2 = "iscarrzkissme"
if (str1 = str2) then
response.write"you cannot have your username in this string"
else
continue on
end if

Something like that.
This is for a password field, to keep people from reusing their username as part of their password.
0
Comment
Question by:Wayne Barron
  • 2
4 Comments
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 34236875
0
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 total points
ID: 34236891
yup, instr is fine. use lcase as well

if instr(lcase(str2), lcase(str1)) > 0 then
  ' there is a case insensitive match
0
 
LVL 30

Author Closing Comment

by:Wayne Barron
ID: 34237809
Thanks Cyber.
It was the lcase that I was missing.
0
 
LVL 30

Author Comment

by:Wayne Barron
ID: 38798933
I had not used this in a while, and had forgotten about how to use it.
So thankful that I had this to look back on.
Thanks once again cyberkiwi

Carrzkiss
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question