home *** CD-ROM | disk | FTP | other *** search
/ Ice Age Fan CD 1 / CD1_Scrat.iso / flash / data / game.swf / scripts / com / terry / swearWordTester.as < prev   
Encoding:
Text File  |  2012-07-04  |  1.2 KB  |  45 lines

  1. package com.terry
  2. {
  3.    public class swearWordTester
  4.    {
  5.       private static var isLegal:Boolean;
  6.       
  7.       private static var si:int;
  8.       
  9.       private static var isBadword:int;
  10.       
  11.       private static var swearWord:String;
  12.       
  13.       private static var testWordLC:String;
  14.       
  15.       private static var swearwordList:Array = new Array("sex","fuk","fuc","cnt","knt","ass","dic","fag","d1k","4q","cun","pis","nig","fu","as5","a55","p1s","fu2","BJ","BJU","bum","cok","cum","tit","t1t","coc","koc","f4g","c0k","c0c","twt","pus","dyk","tlt","sac","sak","s4c","s4k","arse","fuck","shit");
  16.       
  17.       public function swearWordTester()
  18.       {
  19.          super();
  20.       }
  21.       
  22.       public static function testWordForErrors(param1:String) : Boolean
  23.       {
  24.          if(param1.length < 1)
  25.          {
  26.             return false;
  27.          }
  28.          si = 0;
  29.          while(si < swearwordList.length)
  30.          {
  31.             swearWord = swearwordList[si];
  32.             testWordLC = param1.toLowerCase();
  33.             isBadword = testWordLC.indexOf(swearWord);
  34.             if(isBadword != -1)
  35.             {
  36.                return false;
  37.             }
  38.             ++si;
  39.          }
  40.          return true;
  41.       }
  42.    }
  43. }
  44.  
  45.