frozenpeas
Technical User
Hi,
I am trying to disallow banned words in an input string. The trouble is that my function will catch the banned word only if it is the only thing entered. It will allow it if other characters are present in the string.
For example, if the banned word is FACK:
FACK as input is disallowed;
FACKOFF as input is being allowed (which I do not want, since it contains FACK)
Here is where I am at with the function:
Thanks.
frozenpeas
--
Micfo.com Affiliate Program
I am trying to disallow banned words in an input string. The trouble is that my function will catch the banned word only if it is the only thing entered. It will allow it if other characters are present in the string.
For example, if the banned word is FACK:
FACK as input is disallowed;
FACKOFF as input is being allowed (which I do not want, since it contains FACK)
Here is where I am at with the function:
Code:
var contains:Function = function(input,arrayData){
for(var j:Number=0;j<arrayData.length;j++){
if(arrayData[j]==input){
return 1;
}
}
return 0;
}
Thanks.
frozenpeas
--
Micfo.com Affiliate Program