Esempio n. 1
0
    static void Main(string[] args)
    {
        List <string> listUser = new List <string>();

        listUser.Add("user1");
        listUser.Add("user2");
        listUser.Add("userhacker");
        listUser.Add("userfukoff1");
        Blacklist blacklist = new Blacklist();

        blacklist.AddBlacklistedWord("hacker");
        blacklist.AddBlacklistedWord("fukoff");
        foreach (string user in listUser)
        {
            if (blacklist.ContainsBlacklistedWord(user))
            {
                Console.WriteLine("Contains blacklisted word: {0}", user);
            }
        }
    }