I am trying to find and replace text in an xml file using c#. What I want is to change server name in the url link throughout the file.
http://Server1.extranet.abc/server1webdev/rest/services/ABC/ABC_Base/MapServer
to
http://Server2.extranet.abc/server1webdev/rest/services/ABC/ABC_Base/MapServer
I tried using System.xml.linq (XDocument.load(xmlpath)) but it simply gives me the whole xml file as one line of string. Is there a way I can replace the text?Note that the url's are not in specific nodes., they are random throughout file. I am able to do this manually through the file's find and replace, is there a way of doing this programmatically?
String.Replace:xmlString = xmlString.Replace(oldUrl, newUrl)?