How to replace all special character into a string using C#

c#, regex

Solution

Yes, you can use `regular expressions` in C#.

`Using regular expressions with C#`:

using System.Text.RegularExpressions;

string your_String = "Hello@Hello&Hello(Hello)";
string my_String =  Regex.Replace(your_String, @"[^0-9a-zA-Z]+", ",");

Problem

I would like to replace all special characters in a string with a `comma (,)`. For Example: ``` Hello@Hello&Hello(Hello) ``` the output - ``` Hello,Hello,Hello,Hello, ``` (I don't known how to use regexp in C#) Can i do this work using regexp in C#?

Original source