Reputation: 5199
Is there a way to escape all metacharacters in a string with the exception of "*"?
Upvotes: 0
Views: 749
Reputation: 887777
You can call Regex.Escape(str).Replace("\*", "*")
.
If the original string contains \*
, this won't work properly.
Upvotes: 2