WikiFunctions.Tools.UnformattedTextNotChanged C# (CSharp) Method

UnformattedTextNotChanged() public static method

Returns whether the unformatted text content is the same in the two strings Rule is: unformatted text must be entirely missing in new string, or present exactly as before
public static UnformattedTextNotChanged ( string originalArticleText, string articleText ) : bool
originalArticleText string the first string to search
articleText string the second string to search
return bool
        public static bool UnformattedTextNotChanged(string originalArticleText, string articleText)
        {
            if (originalArticleText.Equals(articleText))
                return true;

            List<string> after = (from Match m in WikiRegexes.UnformattedText.Matches(articleText)
                select m.Value).ToList();

            if (!after.Any())
                return true;

            List<string> before = (from Match m in WikiRegexes.UnformattedText.Matches(originalArticleText)
                select m.Value).ToList();

            foreach(string s in before)
            {
                after.Remove(s);
            }

            return (after.Count == 0);
        }
Tools