I am wondering why my string.replace doesnt work , it doesn’t change the path of my string .
This is the code I am using :
WebBrowserTask browser = new WebBrowserTask();
File theFile = new File();
theFile = (File)listBoxFiles.SelectedItem;
var newPath = theFile.Path;
newPath = newPath.Replace("C://inetpub//wwwroot//", "http://,mywebsite.com//Files//");
browser.URL = newPath;
browser.Show();
String.Replacealmost certainly does work. It is most likely you that is mistaken.Check the value of
newPath.Contains("C://inetpub//wwwroot//")– if it’s false it’s because your string doesn’t contain the string you are trying to replace.