[Solved] Replace text inside .txt file or .xml file using loop [closed]
Using xml linq : using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; namespace ConsoleApplication { class Program { static void Main(string[] args) { string xml = @”<Root> <Tag1> <USA></USA> <UK></UK> </Tag1> <Tag2> <FRA></FRA> <USA></USA> </Tag2> </Root>”; XDocument doc = XDocument.Parse(xml); List<XElement> tags = doc.Descendants().Where(x => x.Name.LocalName.StartsWith(“Tag”)).ToList(); List<string> countries = … Read more