In this Blog I'll tell you about How to Replace Special Characters Using Regex in C#.
If you are having a string with special characters and want's to remove/replace them then you can use regex for that.
Use this code:
- Regex.Replace(your String, @"[^0-9a-zA-Z]+", "")
- Regex.Replace(Your String, @"[^0-9a-zA-Z:,]+", "")


Raju VermaPosted Mar 2, 2021, 1:08 AM EST
ADA|$|Air Management System|$|Embedded
ghanshyam lakhaniPosted Aug 17, 2020, 2:28 AM EDT
This is not working for me, i want to allow some special character but it's not working as expected. value = Regex.Replace(value, @"[^0-9A-Za-z ,.!$&()-=@{}[]-]", "")
dev janPosted Sep 22, 2017, 8:11 PM EDT
Regex.Replace(Your String, @"[^0-9a-zA-Z:,]+", "") this function create a new string but sir how change old string with regex for fatchind data
Zeeshan AzimPosted May 15, 2015, 2:56 AM EDT
Thanks. Its great helping so far...