Link to home
Start Free TrialLog in
Avatar of marhk51
marhk51

asked on

How do I do a NON case sensitve search in a string

Hi,

Please can somebody tell me how I can do a NON case sensitve search within a string ??

For example, a user enters their username as 55ADMIN66 or iamADMIN through a form, but they entered a word **within** their username which is not allowed i.e admin,swear words etc.

How do I compare a list of words i.e (NotAllowedUsernames = "admin,owner,moderator,master) to their username name string so I can display and error message.

This is what I've tried:

<CFIF IsDefined("Form.username")>
<CFIF FindNoCase("#notallowedusernames#","#username#") NEQ 0>
<CFSET usernameError = 1>
</CFIF>
</CFIF>

Thanks in advance.
Mark
ASKER CERTIFIED SOLUTION
Avatar of JimV_ATL
JimV_ATL

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marhk51
marhk51

ASKER

Worked great, thanks alot mate :-)
You're welcome!