I would like to write a regular expression that removes special characters for the following reason:
- To remove the space character
@, &, ', (, ), <, >Or#
I wrote this regex that successfully removes spaces:
string username = Regex.Replace(_username, @"\s+", "");
But I would like to update / change it so that it can remove the characters above that I was talking about.
Can someone help me with this?
source
share