Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-11-30
4
Medium Priority
?
354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 34236875
0
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 2000 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 31

Author Closing Comment

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

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

636 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