Ejemplo n.º 1
0
        private static bool GetReplacement(String[] badwords, String[] filterwords, ref string find, ref string replacement)
        {
            if (find == "")
            {
                return(false);
            }

            if (filterwords.Length == 2)
            {
                for (int m = 0; m < badwords.Length; m++)
                {
                    if (filterwords[1].ToString() != "")
                    {
                        replacement = filterwords[1].ToString();
                    }
                }
            }
            else if (filterwords.Length < 2)
            {
                for (int m = 0; m < badwords.Length; m++)
                {
                    replacement = "**";
                }
            }
            else
            {
                replacement = filterwords[filterwords.Length - 1];

                filterwords.SetValue("", filterwords.Length - 1);

                find = string.Join("=", filterwords);
                find = find.Remove(find.Length - 2);
            }

            if (replacement == string.Empty)
            {
                replacement = "**";
            }
            return(true);
        }
Ejemplo n.º 2
0
        private static bool GetReplacement(String[] badwords, String[] filterwords, ref string find, ref string replacement)
        {
            if (find == "")
            {
                return false;
            }

            if (filterwords.Length == 2)
            {
                for (int m = 0; m < badwords.Length; m++)
                {
                    if (filterwords[1].ToString() != "")
                    {
                        replacement = filterwords[1].ToString();
                    }
                }
            }
            else if (filterwords.Length < 2)
            {
                for (int m = 0; m < badwords.Length; m++)
                {
                    replacement = "**";
                }
            }
            else
            {
                replacement = filterwords[filterwords.Length - 1];

                filterwords.SetValue("", filterwords.Length - 1);

                find = string.Join("=", filterwords);
                find = find.Remove(find.Length - 2);
            }

            if (replacement == string.Empty)
            { 
                replacement = "**"; 
            }
            return true;
        }