Replacing characters in a string
Hello. Ok, what I am doing is using an "OpenFileDialogBox" to allow the user to select the location of Internet Explorer on their computer (in case it isn't in the default Program Files\Internet Explorer\iexplore.exe), and then saving the value of that into a database so that later, I can use the stored path to open it with "System.Diagnostics.Process.Start()".
However, the path from the OpenFileDialogBox is something like "C:\Program Files\Internet Explorere\IExplore.exe", and the System.Diagnostics.Process.Start() method requires the backslashes to be escaped with, well, a backslash.
What I need is a for loop or something that will loop through each character in a string and replace each "\" with a "\\". Thank you in advance.
Computers will never surpass the human brain; no computer will ever be able to replicate human stupidity.
__________________
If only computers could write programs themselves...
|