CMS_Migration_Utility.formMigration.StripTags C# (CSharp) Method

StripTags() private method

private StripTags ( ) : void
return void
        private void StripTags()
        {
            string[] tagsToReplace = { "<img", "<script", "<style" };
            string[] endTags = { ">", "</script>", "</style>" };

            for (int i = 0; i < tagsToReplace.Length; i++)
            {
                for (int loc = centerContent.IndexOf(tagsToReplace[i]); loc != -1; loc = centerContent.IndexOf(tagsToReplace[i], loc))
                {
                    string textToRemove = centerContent.Substring(loc, centerContent.IndexOf(endTags[i], loc + tagsToReplace[i].Length + 2) - loc + endTags[i].Length);
                    centerContent = centerContent.Replace(textToRemove, "");
                }
            }
        }