if I’m doing something like that:
someString.Replace("abc","").Replace("def","").Replace(@"c:\Windows","")
How can I replace that with
Regex.Replace(someString," \\here I don't know what the pattern should be")
I’ve tried this:
Regex.Replace(someString, @"(?:abc|def|c:\Windows)")
but it didn’t work
UPD…
The problem is when I pass the path like that
Regex.Replace(someString, @"(?:abc|def|"+aPath+")")
Try this:
It did work when I tried it. I thinks the reason why your code doesn’t work is because you forgot the replacement string and you have to escape the backslash in the path.