0

I am trying to do a string replace for website names. Here is the code:

 string output = input.Replace("C:\Design\Website\", "Someting");
 TextBox.Text = osc.output;

The code is incorrect as there is an issue \ with these marks. How can I fix my code?

user3263967
  • 25
  • 1
  • 6

1 Answers1

1

You need to escape the \:

Either:

"C:\\Design\\Website\\"

Or:

@"C:\Design\Website\"
RagtimeWilly
  • 5,265
  • 3
  • 25
  • 41