如果我正在做这样的事情:
someString.Replace("abc","").Replace("def","").Replace(@"c:\Windows","")
我该如何替换它
Regex.Replace(someString," \\here I don't know what the pattern should be")
我试过这个:
Regex.Replace(someString, @"(?:abc|def|c:\Windows)")
但它没有用
更新...
问题是当我通过这样的路径时
Regex.Replace(someString, @"(?:abc|def|"+aPath+")")