Remove special characters from string using Regex



We can also remove special characters from a given string using Regex

Regex.Replace("InputString", @"[^0-9a-zA-Z]+", "")

We can make changes according to our requirement.

If we don't want to remove comma "," then make changes like this:

Regex.Replace("InputString", @"[^0-9a-zA-Z,]+", "")

0 Comment's

Comment Form