Ejemplo n.º 1
0
        // Token: 0x060027C6 RID: 10182 RVA: 0x000F0B34 File Offset: 0x000EEF34
        public static string filter(string text)
        {
            string text2 = text.ToLower();

            if (text.Length > 0)
            {
                bool flag = text.IndexOf(' ') != -1;
                for (int i = 0; i < ChatManager.SWEARS.Length; i++)
                {
                    string text3 = ChatManager.SWEARS[i];
                    int    num   = text2.IndexOf(text3, 0);
                    while (num != -1)
                    {
                        if (!flag || ((num == 0 || !char.IsLetterOrDigit(text2[num - 1])) && (num == text2.Length - text3.Length || !char.IsLetterOrDigit(text2[num + text3.Length]))))
                        {
                            text2 = ChatManager.replace(text2, num, text3.Length, '#');
                            text  = ChatManager.replace(text, num, text3.Length, '#');
                            num   = text2.IndexOf(text3, num);
                        }
                        else
                        {
                            num = text2.IndexOf(text3, num + 1);
                        }
                    }
                }
            }
            return(text);
        }