WikiFunctions.Parse.MetaDataSorter.MoveTemplateToSection C# (CSharp) Method

MoveTemplateToSection() private static method

Moves the given template(s) to the required section.
private static MoveTemplateToSection ( string articleText, Regex templateRegex, int section ) : string
articleText string /// Article text. ///
templateRegex System.Text.RegularExpressions.Regex /// Regex to match the template(s) to be moved ///
section int /// Section (references/notes/footnotes) ///
return string
        private static string MoveTemplateToSection(string articleText, Regex templateRegex, int section)
        {
            string extractedTemplate = templateRegex.Match(articleText).Value;
            articleText = templateRegex.Replace(articleText, "");

            switch (section)
            {
                case 1:
                    return ReferencesSectionRegex.Replace(articleText, "$0" + extractedTemplate + "\r\n", 1);
                case 2:
                    return NotesSectionRegex.Replace(articleText, "$0" + extractedTemplate + "\r\n", 1);
                case 3:
                    return FootnotesSectionRegex.Replace(articleText, "$0" + extractedTemplate + "\r\n", 1);
                default:
                    return articleText;
            }
        }