Beispiel #1
0
        /// <summary>
        ///     Checks the specified string.
        /// </summary>
        /// <param name="str">The string.</param>
        /// <param name="type">The type.</param>
        /// <param name="word">The word.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public static bool Check(string str, BlackWordType type, out BlackWord word)
        {
            word = Empty;

            if (!Replaces.ContainsKey(type))
            {
                return(false);
            }

            BlackWordTypeSettings data = Replaces[type];

            str = UserChatInputFilter.Replace(data.Filter, str);

            BlackWord wordFirst = Words.FirstOrDefault(wordStruct => wordStruct.Type == type && str.Contains(wordStruct.Word));

            word = wordFirst;

            return(!string.IsNullOrEmpty(wordFirst.Word));
        }