By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,736 Members | 1,348 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,736 IT Pros & Developers. It's quick & easy.

Help with regex?

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

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

??
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Hi Lucio ! :O)

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

--
Best Regards
Yanick
<Lucio H> a écrit dans le message de
news:e%****************@TK2MSFTNGP12.phx.gbl...
Does anyone know how to change / into \ in a string
and do it for all occurances?

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

??

Nov 21 '05 #2

P: n/a
> 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?
Nov 21 '05 #3

P: n/a
Lucio,

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

I hope this helps,

Cor
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.