CMS_Migration_Utility.formMigration.StripAttributes C# (CSharp) Method

StripAttributes() private method

private StripAttributes ( ) : void
return void
        private void StripAttributes()
        {
            string[] attributes = { @" style=""", @" class=""", " style='", " class='" };
            string[] closingCharacter = { @"""", @"""", "'", "'" };

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