Help with regex?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to change / into \ in a string
and do it for all occurances?

Regex.Replace(s, "\\", "/")

??
 
Hi Lucio ! :O)

There is no need for Regex here.. :
'***
s = s.Replace("/", "\")
'***
 
s = s.Replace("/", "\")

Hi, I have a slight problem, my string has embeded quotes like this

""one\two\three\etc""

this seems to prevent the change, any ideas why?
 
Lucio,

No, because this gives exactly the result you asked for.
MessageBox.Show("""one\two\three\etc""".Replace("\", "/"))

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top