Regular expression to check for special characters except space
I want to check for special characters in a string EXCEPT spaces and delete them.
Ex: input = "Oh Boy!!#$" output = "Oh Boy"
Can someone help me w开发者_如何学Pythonith the regular expression to implement this in C#
This is one way:
Console.WriteLine(Regex.Replace("Oh Boy!!#$", @"[^\w ]", ""));
精彩评论