Removing special characters with Regular Expression in C#.NET

Hi,
I would like to replace the following characters in an input string:
"$'&+,/:;=?@<>#%{}|\^~][`

I'm using ASP.NET and C#
I'm looking for code that looks something like this:

string specials = "\"'$&+,/:;=?@<>#%{}|\\^~][`";
Regex regex = new Regex(specials);
string output = regex.Replace("input with specials", "x");

Above code compiles but doesn't work.
Any help is appreciated.

Thanks

z
LVL 1
tyconz_helpdesk2008Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ozoConnect With a Mentor Commented:
string specials = "[\"'$&+,/:;=?@<>#%{}|\\\\^~\\]\\[`]";
0
All Courses

From novice to tech pro — start learning today.