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, 6:08 AM
ADA|$|Air Management System|$|Embedded
ghanshyam lakhaniPosted Aug 17, 2020, 6:28 AM
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 23, 2017, 12:11 AM
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, 6:56 AM
Thanks. Its great helping so far...